Panel Interface Board  1
inszt_wl_sps.c
Go to the documentation of this file.
1 /*
2 C TESTBED VERSION : 9.7.2
3 FILE UNDER TEST : "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.c"
4 DATE OF ANALYSIS : Thu Aug 27 13:28:51 2020
5 */
6 /**************************************************************************************/
25 /**************************************************************************************/
26 /**************************************************************************************/
27 /* Section: Included Files */
28 /**************************************************************************************/
29 /**************************************************************************************/
30 #define QQQdialect MPLABX
31 #undef QQQ146
32 #undef QQQ148
33 #undef QQQbndchk
34 #undef QQQ294
35 #undef QQQEMBEDDEDICE
36  /* Note: for BITMAP execution histories QQQthreaded is not defined */
37 #undef QQQthreaded
38 #undef QQQdo178b
39 #undef QQQfixbra
40 #define QQQswitch3
41 #undef QQQternary
42 #define QQQswitch
43 #undef QQQmacrof
44 #undef QQQMULTIPROCESSEXH
45 #undef QQFLUSH
46 #undef QQNEWBS
47 #define qqqMaxBranchDepth 20
48 #define QQQstructbitmap
49  static int qqqqbmselwidth = 32 ;
50  static int zzfileid = 50;
51 #define QQQnumfil 23
52 #undef QQQALGONE
53 #undef QQQVCLFLG
54 #undef QQQFORKFL
55 #undef QQQIADDRF
56 #undef QQQRTI
57 #undef QQQPERFA
58 #undef QQQADRMOD
59 #undef QQQDCAPFL
60 #undef QQQTEMPLATEONLY
61 #define QQQNOATEXIT
62 #define QQQUPLOADATEND
63 #define QQQNOSTDIO
64 #undef QQQASHLINGVITRA
65 #define QQQBITMAP
66  #define qqqbitmapint unsigned int
67 #undef QQQBITMAPMCDC
68 #undef QQQTIC2XSERIALIO
69 #undef QQQTIC2XFLASH
70 #undef QQQCOMPRESSED_EXH
71 #undef QQQMAINFL
72 #define QQQSINGLEFILE
73 #define QQQFILEID
74 #define QQQseparate
75 extern int QQQindicator;
76 static int QQQfirstmcdc=1;
77 #define wl_sps_50zzopen zzopen
78  extern int wl_sps_50zzopen ;
79 #define wl_sps_50zqqzqz1 zqqzqz1
80 #define QQQLDRA_PORT
81 #ifndef QQQLDRA_PORT
82 #define FILEPOINT FILE * f,
83 #if !defined(QQQTEMPLATEONLY) && !defined(FILE) && !defined(QQQNOSTDIO)
84 #include <stdio.h>
85  /* ----------------------------------------------------------------------* 100 *
86  * If stdio.h is not available then insert:
87  * typedef int * FILE;
88  * -----------------------------------------------------------------------------
89  */
90 #endif /* !(QQQTEMPLATEONLY) && !(FILE) && !(QQQNOSTDIO) */
91 #else /* QQQLDRA_PORT */
92 #define FILEPOINT
93 /*************************** LDRA_PORT *********************************/
94 #ifdef QQQ_SHLAYOUT
95 static int tbrun_mode=1;
96 #else
97 static int tbrun_mode=0;
98 #endif /* QQQ_SHLAYOUT */
99 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.h"
100 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.h"
101 #ifndef QQQ_SHLAYOUT
102 #ifdef QQQMAINFL
103 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port.c"
104 #include "C:\LDRA_Toolsuite\Compiler_spec\Microchip\Mplabx_xc32_script\ldra_port_common.c"
105 #endif /* QQQMAINFL */
106 #endif /* QQQ_SHLAYOUT */
107 /************************ END OF LDRA_PORT *****************************/
108 #endif /* QQQLDRA_PORT */
109 #ifndef QQQnumfil
110 #define QQQnumfil 40 /* default setting */
111 #endif /* QQQnumfil */
112 #if defined(QQQstructbitmap) && defined(QQQSINGLEFILE)
113 #ifndef LDRA_VOID_FUNC
114 #define LDRA_VOID_FUNC
115  typedef void(*ldra_void_function)();
116 #endif
117 #if defined(QQQMAINFL)
118  /* Set qqqshell_upload to 1 if you want to call the qqqtotalupload separately. Although
119  through the target you would have to set this to 0 before calling the qqqupload.
120  Move this into ldra_port mechanism. */
121  int qqqshell_upload = 0;
122  int QQQfcn_ptr_num = 0;
123  static int qqqisinitialised = 0;
126  void qqqtotalupload(void);
127  void qqqtotalreset(void);
129  qqqaccumupload[x]=y;
130  qqqaccumreset[x]=z;
131  QQQfcn_ptr_num++;
132  }
133 #else /* (QQQMAINFL) */
134  extern int QQQfcn_ptr_num;
137  static int qqqstructzzopen = 0;
138 #endif /* defined(QQQMAINFL) */
139 #endif /* defined(QQQstructbitmap) && defined(QQQSINGLEFILE) */
140 #ifdef QQQ_KEEPCOMMENTS
141  /* -----------------------------------------------------------------------* 101 *
142  * Special settings for systems lacking standard functions.
143  * To include code for fprintf define ldra_fprintf
144  * To include code for sscanf define ldra_sscanf
145  * -----------------------------------------------------------------------------
146  */
147 #endif /* QQQ_KEEPCOMMENTS */
148 #if !defined(QQQSUPPRESS_UNDEF)
149 #undef ldra_fprintf
150 #undef ldra_sscanf
151 #endif /* !defined(QQQSUPPRESS_UNDEF) */
152  /* #define ldra_fprintf */
153  /* #define ldra_sscanf */
154 #undef QQQHITMAP_STORAGE
155 #undef qqnull_params
156 #define qqnull_params void
157 #define QQQ_PROTOTYPE_DEF
158  /* Conventional Instrumentation */
159 #undef QQ_ANSI_PROTOTYPE
160 #ifdef __STDC__
161 #define QQ_ANSI_PROTOTYPE 1
162 #else /* __STDC__ */
163 #ifdef VAXC
164 #define QQ_ANSI_PROTOTYPE 1
165 #endif /* VAXC */
166 #endif /* __STDC__ */
167  static unsigned char qqqzzglobflag = 0;
168  static struct bitmapstruct_t
169  {
170 #define ELEMENT(N) qqqbitmapint element##N;
171 #define LASTELEMENT
172 #include "wl_sps_50zbelem.def"
173 #undef ELEMENT
174 #undef LASTELEMENT
175  } bitmapstruct = {
176 #define ELEMENT(N) 0,
177 #undef LASTELEMENT
178 #include "wl_sps_50zbelem.def"
179 #undef ELEMENT
180  0};
181  static void qqoutput(FILEPOINT char * s,int i);
182  static void qqoutput2(FILEPOINT char * s,int i, int j);
183  static void qqoutput3(FILEPOINT char * s,int i,int j,int k);
184  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l);
185  static void qqoutput0(FILEPOINT char * s);
186  static int wl_sps_50zqqzqz(qqnull_params);
187  static int wl_sps_50zqqzqz1(qqnull_params);
188  static int wl_sps_50zqendz (int qqqi);
189  static int wl_sps_50zqzqzq (int qqqi);
190  static void qqqupload(qqnull_params);
191  static void qqqbitmapreset(qqnull_params);
192 /* ------------------------------ END OF TESTBED PROTOTYPES -------------------------------- */
193 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.h */
194 /**************************************************************************************/
210 /**************************************************************************************/
211 #ifndef WL_SPS_H /* Guard against multiple inclusion */
212 #define WL_SPS_H
213 /**************************************************************************************/
214 /**************************************************************************************/
215 /* Section: Included Files */
216 /**************************************************************************************/
217 /**************************************************************************************/
218 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h */
219 /*******************************************************************************
220  MPLAB Harmony System Configuration Header
221  File Name:
222  system_config.h
223  Summary:
224  Build-time configuration header for the system defined by this MPLAB Harmony
225  project.
226  Description:
227  An MPLAB Project may have multiple configurations. This file defines the
228  build-time options for a single configuration.
229  Remarks:
230  This configuration header must not define any prototypes or data
231  definitions (or include any files that do). It only provides macro
232  definitions for build-time configuration options that are not instantiated
233  until used by another MPLAB Harmony module or application.
234  Created with MPLAB Harmony Version 2.06
235 *******************************************************************************/
236 // DOM-IGNORE-BEGIN
237 /*******************************************************************************
238 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
239 Microchip licenses to you the right to use, modify, copy and distribute
240 Software only when embedded on a Microchip microcontroller or digital signal
241 controller that is integrated into your product or third party product
242 (pursuant to the sublicense terms in the accompanying license agreement).
243 You should refer to the license agreement accompanying this Software for
244 additional information regarding your rights and obligations.
245 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
246 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
247 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
248 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
249 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
250 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
251 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
252 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
253 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
254 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
255 *******************************************************************************/
256 // DOM-IGNORE-END
257 #ifndef _SYSTEM_CONFIG_H
258 #define _SYSTEM_CONFIG_H
259 // *****************************************************************************
260 // *****************************************************************************
261 // Section: Included Files
262 // *****************************************************************************
263 // *****************************************************************************
264 /* This section Includes other configuration headers necessary to completely
265  define this configuration.
266 */
267 // DOM-IGNORE-BEGIN
268 // DOM-IGNORE-END
269 // *****************************************************************************
270 // *****************************************************************************
271 // Section: System Service Configuration
272 // *****************************************************************************
273 // *****************************************************************************
274 // *****************************************************************************
275 /* Common System Service Configuration Options
276 */
277 #define SYS_VERSION_STR "2.06"
278 #define SYS_VERSION 20600
279 // *****************************************************************************
280 /* Clock System Service Configuration Options
281 */
282 #define SYS_CLK_FREQ 200000000ul
283 #define SYS_CLK_BUS_PERIPHERAL_1 100000000ul
284 #define SYS_CLK_BUS_PERIPHERAL_2 100000000ul
285 #define SYS_CLK_BUS_PERIPHERAL_3 100000000ul
286 #define SYS_CLK_BUS_PERIPHERAL_4 100000000ul
287 #define SYS_CLK_BUS_PERIPHERAL_5 100000000ul
288 #define SYS_CLK_BUS_PERIPHERAL_7 200000000ul
289 #define SYS_CLK_BUS_PERIPHERAL_8 100000000ul
290 #define SYS_CLK_CONFIG_PRIMARY_XTAL 0ul
291 #define SYS_CLK_CONFIG_SECONDARY_XTAL 32768ul
292 /*** Ports System Service Configuration ***/
293 #define SYS_PORT_A_ANSEL 0x3F00
294 #define SYS_PORT_A_TRIS 0xFFED
295 #define SYS_PORT_A_LAT 0x0010
296 #define SYS_PORT_A_ODC 0x0000
297 #define SYS_PORT_A_CNPU 0x0020
298 #define SYS_PORT_A_CNPD 0x0000
299 #define SYS_PORT_A_CNEN 0x0021
300 #define SYS_PORT_B_ANSEL 0x10C8
301 #define SYS_PORT_B_TRIS 0x91FF
302 #define SYS_PORT_B_LAT 0x0000
303 #define SYS_PORT_B_ODC 0x0000
304 #define SYS_PORT_B_CNPU 0x0000
305 #define SYS_PORT_B_CNPD 0x0000
306 #define SYS_PORT_B_CNEN 0x0000
307 #define SYS_PORT_C_ANSEL 0xCFE1
308 #define SYS_PORT_C_TRIS 0xFFFF
309 #define SYS_PORT_C_LAT 0x0000
310 #define SYS_PORT_C_ODC 0x0000
311 #define SYS_PORT_C_CNPU 0x0000
312 #define SYS_PORT_C_CNPD 0x0000
313 #define SYS_PORT_C_CNEN 0x0000
314 #define SYS_PORT_D_ANSEL 0xC100
315 #define SYS_PORT_D_TRIS 0xFFFF
316 #define SYS_PORT_D_LAT 0x0000
317 #define SYS_PORT_D_ODC 0x0000
318 #define SYS_PORT_D_CNPU 0x0000
319 #define SYS_PORT_D_CNPD 0x0000
320 #define SYS_PORT_D_CNEN 0x0000
321 #define SYS_PORT_E_ANSEL 0xFC00
322 #define SYS_PORT_E_TRIS 0xFDFF
323 #define SYS_PORT_E_LAT 0x0000
324 #define SYS_PORT_E_ODC 0x0000
325 #define SYS_PORT_E_CNPU 0x0000
326 #define SYS_PORT_E_CNPD 0x0000
327 #define SYS_PORT_E_CNEN 0x0000
328 #define SYS_PORT_F_ANSEL 0xCEC0
329 #define SYS_PORT_F_TRIS 0xEFFF
330 #define SYS_PORT_F_LAT 0x0000
331 #define SYS_PORT_F_ODC 0x0000
332 #define SYS_PORT_F_CNPU 0x0000
333 #define SYS_PORT_F_CNPD 0x0000
334 #define SYS_PORT_F_CNEN 0x0000
335 #define SYS_PORT_G_ANSEL 0x8CBC
336 #define SYS_PORT_G_TRIS 0xDFFF
337 #define SYS_PORT_G_LAT 0x0000
338 #define SYS_PORT_G_ODC 0x0000
339 #define SYS_PORT_G_CNPU 0x0000
340 #define SYS_PORT_G_CNPD 0x0000
341 #define SYS_PORT_G_CNEN 0x0000
342 #define SYS_PORT_H_ANSEL 0x0070
343 #define SYS_PORT_H_TRIS 0xB3FB
344 #define SYS_PORT_H_LAT 0x0000
345 #define SYS_PORT_H_ODC 0x0000
346 #define SYS_PORT_H_CNPU 0x0000
347 #define SYS_PORT_H_CNPD 0x0000
348 #define SYS_PORT_H_CNEN 0x0000
349 #define SYS_PORT_J_ANSEL 0x0000
350 #define SYS_PORT_J_TRIS 0x8B7F
351 #define SYS_PORT_J_LAT 0x0080
352 #define SYS_PORT_J_ODC 0x0000
353 #define SYS_PORT_J_CNPU 0x0000
354 #define SYS_PORT_J_CNPD 0x0000
355 #define SYS_PORT_J_CNEN 0x0800
356 #define SYS_PORT_K_ANSEL 0xFF00
357 #define SYS_PORT_K_TRIS 0xFFFF
358 #define SYS_PORT_K_LAT 0x0000
359 #define SYS_PORT_K_ODC 0x0000
360 #define SYS_PORT_K_CNPU 0x0000
361 #define SYS_PORT_K_CNPD 0x0000
362 #define SYS_PORT_K_CNEN 0x0000
363 /*** Interrupt System Service Configuration ***/
364 #define SYS_INT true
365 /*** Timer System Service Configuration ***/
366 #define SYS_TMR_POWER_STATE SYS_MODULE_POWER_RUN_FULL
367 #define SYS_TMR_DRIVER_INDEX DRV_TMR_INDEX_0
368 #define SYS_TMR_MAX_CLIENT_OBJECTS 5
369 #define SYS_TMR_FREQUENCY 1000
370 #define SYS_TMR_FREQUENCY_TOLERANCE 10
371 #define SYS_TMR_UNIT_RESOLUTION 10000
372 #define SYS_TMR_CLIENT_TOLERANCE 10
373 #define SYS_TMR_INTERRUPT_NOTIFICATION false
374 // *****************************************************************************
375 // *****************************************************************************
376 // Section: Driver Configuration
377 // *****************************************************************************
378 // *****************************************************************************
379 #define DRV_IC_DRIVER_MODE_STATIC
380 #define USE_8BIT_PMP
381 /*** SPI Driver Configuration ***/
382 #define DRV_SPI_NUMBER_OF_MODULES 6
383 /*** Driver Compilation and static configuration options. ***/
384 /*** Select SPI compilation units.***/
385 #define DRV_SPI_POLLED 1
386 #define DRV_SPI_ISR 0
387 #define DRV_SPI_MASTER 1
388 #define DRV_SPI_SLAVE 0
389 #define DRV_SPI_RM 0
390 #define DRV_SPI_EBM 1
391 #define DRV_SPI_8BIT 1
392 #define DRV_SPI_16BIT 1
393 #define DRV_SPI_32BIT 0
394 #define DRV_SPI_DMA 0
395 /*** SPI Driver Static Allocation Options ***/
396 #define DRV_SPI_INSTANCES_NUMBER 3
397 #define DRV_SPI_CLIENTS_NUMBER 3
398 #define DRV_SPI_ELEMENTS_PER_QUEUE 10
399 /* SPI Driver Instance 0 Configuration */
400 #define DRV_SPI_SPI_ID_IDX0 SPI_ID_1
401 #define DRV_SPI_TASK_MODE_IDX0 DRV_SPI_TASK_MODE_POLLED
402 #define DRV_SPI_SPI_MODE_IDX0 DRV_SPI_MODE_MASTER
403 #define DRV_SPI_ALLOW_IDLE_RUN_IDX0 false
404 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX0 DRV_SPI_PROTOCOL_TYPE_FRAMED
405 #define DRV_SPI_FRAME_SYNC_PULSE_IDX0 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
406 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX0 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
407 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX0 SPI_FRAME_PULSE_DIRECTION_OUTPUT
408 #define DRV_SPI_FRAME_PULSE_EDGE_IDX0 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
409 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX0 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
410 #define DRV_SPI_COMM_WIDTH_IDX0 SPI_COMMUNICATION_WIDTH_16BITS
411 #define DRV_SPI_CLOCK_SOURCE_IDX0 SPI_BAUD_RATE_PBCLK_CLOCK
412 #define DRV_SPI_SPI_CLOCK_IDX0 CLK_BUS_PERIPHERAL_2
413 #define DRV_SPI_BAUD_RATE_IDX0 1000000
414 #define DRV_SPI_BUFFER_TYPE_IDX0 DRV_SPI_BUFFER_TYPE_ENHANCED
415 #define DRV_SPI_CLOCK_MODE_IDX0 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
416 #define DRV_SPI_INPUT_PHASE_IDX0 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
417 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX0 0xFFFF
418 #define DRV_SPI_QUEUE_SIZE_IDX0 10
419 #define DRV_SPI_RESERVED_JOB_IDX0 1
420 /* SPI Driver Instance 1 Configuration */
421 #define DRV_SPI_SPI_ID_IDX1 SPI_ID_2
422 #define DRV_SPI_TASK_MODE_IDX1 DRV_SPI_TASK_MODE_POLLED
423 #define DRV_SPI_SPI_MODE_IDX1 DRV_SPI_MODE_MASTER
424 #define DRV_SPI_ALLOW_IDLE_RUN_IDX1 false
425 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX1 DRV_SPI_PROTOCOL_TYPE_FRAMED
426 #define DRV_SPI_FRAME_SYNC_PULSE_IDX1 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
427 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX1 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
428 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX1 SPI_FRAME_PULSE_DIRECTION_OUTPUT
429 #define DRV_SPI_FRAME_PULSE_EDGE_IDX1 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
430 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX1 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
431 #define DRV_SPI_COMM_WIDTH_IDX1 SPI_COMMUNICATION_WIDTH_8BITS
432 #define DRV_SPI_CLOCK_SOURCE_IDX1 SPI_BAUD_RATE_PBCLK_CLOCK
433 #define DRV_SPI_SPI_CLOCK_IDX1 CLK_BUS_PERIPHERAL_2
434 #define DRV_SPI_BAUD_RATE_IDX1 1000000
435 #define DRV_SPI_BUFFER_TYPE_IDX1 DRV_SPI_BUFFER_TYPE_ENHANCED
436 #define DRV_SPI_CLOCK_MODE_IDX1 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
437 #define DRV_SPI_INPUT_PHASE_IDX1 SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE
438 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX1 0xFF
439 #define DRV_SPI_QUEUE_SIZE_IDX1 10
440 #define DRV_SPI_RESERVED_JOB_IDX1 1
441 /* SPI Driver Instance 2 Configuration */
442 #define DRV_SPI_SPI_ID_IDX2 SPI_ID_4
443 #define DRV_SPI_TASK_MODE_IDX2 DRV_SPI_TASK_MODE_POLLED
444 #define DRV_SPI_SPI_MODE_IDX2 DRV_SPI_MODE_MASTER
445 #define DRV_SPI_ALLOW_IDLE_RUN_IDX2 false
446 #define DRV_SPI_SPI_PROTOCOL_TYPE_IDX2 DRV_SPI_PROTOCOL_TYPE_FRAMED
447 #define DRV_SPI_FRAME_SYNC_PULSE_IDX2 SPI_FRAME_SYNC_PULSE_ON_EVERY_DATA_CHARACTER
448 #define DRV_SPI_FRAME_PULSE_POLARITY_IDX2 SPI_FRAME_PULSE_POLARITY_ACTIVE_LOW
449 #define DRV_SPI_FRAME_PULSE_DIRECTION_IDX2 SPI_FRAME_PULSE_DIRECTION_OUTPUT
450 #define DRV_SPI_FRAME_PULSE_EDGE_IDX2 SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK
451 #define DRV_SPI_FRAME_PULSE_WIDTH_IDX2 SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH
452 #define DRV_SPI_COMM_WIDTH_IDX2 SPI_COMMUNICATION_WIDTH_16BITS
453 #define DRV_SPI_CLOCK_SOURCE_IDX2 SPI_BAUD_RATE_PBCLK_CLOCK
454 #define DRV_SPI_SPI_CLOCK_IDX2 CLK_BUS_PERIPHERAL_2
455 #define DRV_SPI_BAUD_RATE_IDX2 500000
456 #define DRV_SPI_BUFFER_TYPE_IDX2 DRV_SPI_BUFFER_TYPE_ENHANCED
457 #define DRV_SPI_CLOCK_MODE_IDX2 DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL
458 #define DRV_SPI_INPUT_PHASE_IDX2 SPI_INPUT_SAMPLING_PHASE_AT_END
459 #define DRV_SPI_TRANSMIT_DUMMY_BYTE_VALUE_IDX2 0x0000
460 #define DRV_SPI_QUEUE_SIZE_IDX2 10
461 #define DRV_SPI_RESERVED_JOB_IDX2 1
462 /*** Timer Driver Configuration ***/
463 #define DRV_TMR_INTERRUPT_MODE true
464 /*** Timer Driver 0 Configuration ***/
465 #define DRV_TMR_PERIPHERAL_ID_IDX0 TMR_ID_2
466 #define DRV_TMR_INTERRUPT_SOURCE_IDX0 INT_SOURCE_TIMER_2
467 #define DRV_TMR_INTERRUPT_VECTOR_IDX0 INT_VECTOR_T2
468 #define DRV_TMR_ISR_VECTOR_IDX0 _TIMER_2_VECTOR
469 #define DRV_TMR_INTERRUPT_PRIORITY_IDX0 INT_PRIORITY_LEVEL4
470 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX0 INT_SUBPRIORITY_LEVEL0
471 #define DRV_TMR_CLOCK_SOURCE_IDX0 DRV_TMR_CLKSOURCE_INTERNAL
472 #define DRV_TMR_PRESCALE_IDX0 TMR_PRESCALE_VALUE_8
473 #define DRV_TMR_OPERATION_MODE_IDX0 DRV_TMR_OPERATION_MODE_16_BIT
474 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX0 false
475 #define DRV_TMR_POWER_STATE_IDX0
476 #define DRV_TMR_PERIPHERAL_ID_IDX1 TMR_ID_7
477 #define DRV_TMR_INTERRUPT_SOURCE_IDX1 INT_SOURCE_TIMER_7
478 #define DRV_TMR_INTERRUPT_VECTOR_IDX1 INT_VECTOR_T7
479 #define DRV_TMR_ISR_VECTOR_IDX1 _TIMER_7_VECTOR
480 #define DRV_TMR_INTERRUPT_PRIORITY_IDX1 INT_PRIORITY_LEVEL3
481 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX1 INT_SUBPRIORITY_LEVEL0
482 #define DRV_TMR_CLOCK_SOURCE_IDX1 DRV_TMR_CLKSOURCE_INTERNAL
483 #define DRV_TMR_PRESCALE_IDX1 TMR_PRESCALE_VALUE_16
484 #define DRV_TMR_OPERATION_MODE_IDX1 DRV_TMR_OPERATION_MODE_16_BIT
485 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX1 false
486 #define DRV_TMR_POWER_STATE_IDX1
487 /*** Timer Driver 2 Configuration ***/
488 #define DRV_TMR_PERIPHERAL_ID_IDX2 TMR_ID_6
489 #define DRV_TMR_INTERRUPT_SOURCE_IDX2 INT_SOURCE_TIMER_6
490 #define DRV_TMR_INTERRUPT_VECTOR_IDX2 INT_VECTOR_T6
491 #define DRV_TMR_ISR_VECTOR_IDX2 _TIMER_6_VECTOR
492 #define DRV_TMR_INTERRUPT_PRIORITY_IDX2 INT_PRIORITY_LEVEL1
493 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX2 INT_SUBPRIORITY_LEVEL0
494 #define DRV_TMR_CLOCK_SOURCE_IDX2 DRV_TMR_CLKSOURCE_INTERNAL
495 #define DRV_TMR_PRESCALE_IDX2 TMR_PRESCALE_VALUE_16
496 #define DRV_TMR_OPERATION_MODE_IDX2 DRV_TMR_OPERATION_MODE_16_BIT
497 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX2 false
498 #define DRV_TMR_POWER_STATE_IDX2
499 /*** Timer Driver 3 Configuration ***/
500 #define DRV_TMR_PERIPHERAL_ID_IDX3 TMR_ID_1
501 #define DRV_TMR_INTERRUPT_SOURCE_IDX3 INT_SOURCE_TIMER_1
502 #define DRV_TMR_INTERRUPT_VECTOR_IDX3 INT_VECTOR_T1
503 #define DRV_TMR_ISR_VECTOR_IDX3 _TIMER_1_VECTOR
504 #define DRV_TMR_INTERRUPT_PRIORITY_IDX3 INT_PRIORITY_LEVEL2
505 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX3 INT_SUBPRIORITY_LEVEL0
506 #define DRV_TMR_CLOCK_SOURCE_IDX3 DRV_TMR_CLKSOURCE_INTERNAL
507 #define DRV_TMR_PRESCALE_IDX3 TMR_PRESCALE_VALUE_256
508 #define DRV_TMR_OPERATION_MODE_IDX3 DRV_TMR_OPERATION_MODE_16_BIT
509 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX3 false
510 #define DRV_TMR_POWER_STATE_IDX3
511 /*** Timer Driver 4 Configuration ***/
512 #define DRV_TMR_PERIPHERAL_ID_IDX4 TMR_ID_3
513 #define DRV_TMR_INTERRUPT_SOURCE_IDX4 INT_SOURCE_TIMER_3
514 #define DRV_TMR_INTERRUPT_VECTOR_IDX4 INT_VECTOR_T3
515 #define DRV_TMR_ISR_VECTOR_IDX4 _TIMER_3_VECTOR
516 #define DRV_TMR_INTERRUPT_PRIORITY_IDX4 INT_PRIORITY_LEVEL1
517 #define DRV_TMR_INTERRUPT_SUB_PRIORITY_IDX4 INT_SUBPRIORITY_LEVEL0
518 #define DRV_TMR_CLOCK_SOURCE_IDX4 DRV_TMR_CLKSOURCE_INTERNAL
519 #define DRV_TMR_PRESCALE_IDX4 TMR_PRESCALE_VALUE_16
520 #define DRV_TMR_OPERATION_MODE_IDX4 DRV_TMR_OPERATION_MODE_16_BIT
521 #define DRV_TMR_ASYNC_WRITE_ENABLE_IDX4 false
522 #define DRV_TMR_POWER_STATE_IDX4
523  // *****************************************************************************
524 /* USART Driver Configuration Options
525 */
526 #define DRV_USART_INSTANCES_NUMBER 1
527 #define DRV_USART_CLIENTS_NUMBER 1
528 #define DRV_USART_INTERRUPT_MODE false
529 #define DRV_USART_BYTE_MODEL_SUPPORT true
530 #define DRV_USART_READ_WRITE_MODEL_SUPPORT false
531 #define DRV_USART_BUFFER_QUEUE_SUPPORT false
532 // *****************************************************************************
533 // *****************************************************************************
534 // Section: Middleware & Other Library Configuration
535 // *****************************************************************************
536 // *****************************************************************************
537 /*** USB Driver Configuration ***/
538 /* Enables Device Support */
539 #define DRV_USBHS_DEVICE_SUPPORT true
540 /* Disable Host Support */
541 #define DRV_USBHS_HOST_SUPPORT false
542 /* Maximum USB driver instances */
543 #define DRV_USBHS_INSTANCES_NUMBER 1
544 /* Interrupt mode enabled */
545 #define DRV_USBHS_INTERRUPT_MODE true
546 /* Number of Endpoints used */
547 #define DRV_USBHS_ENDPOINTS_NUMBER 2
548 /*** USB Device Stack Configuration ***/
549 /* The USB Device Layer will not initialize the USB Driver */
550 #define USB_DEVICE_DRIVER_INITIALIZE_EXPLICIT
551 /* Maximum device layer instances */
552 #define USB_DEVICE_INSTANCES_NUMBER 1
553 /* EP0 size in bytes */
554 #define USB_DEVICE_EP0_BUFFER_SIZE 64
555 /* Endpoint Transfer Queue Size combined for Read and write */
556 #define USB_DEVICE_ENDPOINT_QUEUE_DEPTH_COMBINED 2
557 // *****************************************************************************
558 // *****************************************************************************
559 // Section: Application Configuration
560 // *****************************************************************************
561 // *****************************************************************************
562 /*** Application Defined Pins ***/
563 /*** Functions for LED1 pin ***/
564 #define LED1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
565 #define LED1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
566 #define LED1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
567 #define LED1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 )
568 #define LED1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_12 , Value )
569 /*** Functions for LED2 pin ***/
570 #define LED2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
571 #define LED2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
572 #define LED2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
573 #define LED2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 )
574 #define LED2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 , Value )
575 /*** Functions for DMP_FIRE_LED pin ***/
576 #define DMP_FIRE_LEDToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
577 #define DMP_FIRE_LEDOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
578 #define DMP_FIRE_LEDOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
579 #define DMP_FIRE_LEDStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 )
580 #define DMP_FIRE_LEDStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_9 , Value )
581 /*** Functions for HVPS_ENB pin ***/
582 #define HVPS_ENBToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
583 #define HVPS_ENBOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
584 #define HVPS_ENBOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
585 #define HVPS_ENBStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 )
586 #define HVPS_ENBStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_13 , Value )
587 /*** Functions for RLY_HVPS_OUT pin ***/
588 #define RLY_HVPS_OUTToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
589 #define RLY_HVPS_OUTOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
590 #define RLY_HVPS_OUTOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
591 #define RLY_HVPS_OUTStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 )
592 #define RLY_HVPS_OUTStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_14 , Value )
593 /*** Functions for RLY_WL_SPS_POL pin ***/
594 #define RLY_WL_SPS_POLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
595 #define RLY_WL_SPS_POLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
596 #define RLY_WL_SPS_POLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
597 #define RLY_WL_SPS_POLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 )
598 #define RLY_WL_SPS_POLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_2 , Value )
599 /*** Functions for RLY_LOG pin ***/
600 #define RLY_LOGToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
601 #define RLY_LOGOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
602 #define RLY_LOGOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
603 #define RLY_LOGStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 )
604 #define RLY_LOGStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_9 , Value )
605 /*** Functions for RLY_DMP_FIRE pin ***/
606 #define RLY_DMP_FIREToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
607 #define RLY_DMP_FIREOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
608 #define RLY_DMP_FIREOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
609 #define RLY_DMP_FIREStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 )
610 #define RLY_DMP_FIREStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_10 , Value )
611 /*** Functions for RLY_AUX pin ***/
612 #define RLY_AUXToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
613 #define RLY_AUXOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
614 #define RLY_AUXOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
615 #define RLY_AUXStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 )
616 #define RLY_AUXStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_11 , Value )
617 /*** Functions for RLY_CCL pin ***/
618 #define RLY_CCLToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
619 #define RLY_CCLOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
620 #define RLY_CCLOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
621 #define RLY_CCLStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 )
622 #define RLY_CCLStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_1 , Value )
623 /*** Functions for RLY_WL_MON pin ***/
624 #define RLY_WL_MONToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
625 #define RLY_WL_MONOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
626 #define RLY_WL_MONOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
627 #define RLY_WL_MONStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 )
628 #define RLY_WL_MONStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_12 , Value )
629 /*** Functions for RLY_ARMCF pin ***/
630 #define RLY_ARMCFToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
631 #define RLY_ARMCFOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
632 #define RLY_ARMCFOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
633 #define RLY_ARMCFStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 )
634 #define RLY_ARMCFStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_13 , Value )
635 /*** Functions for RLY_ARM pin ***/
636 #define RLY_ARMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
637 #define RLY_ARMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
638 #define RLY_ARMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
639 #define RLY_ARMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 )
640 #define RLY_ARMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_14 , Value )
641 /*** Functions for TPAN1 pin ***/
642 #define TPAN1Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
643 #define TPAN1On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
644 #define TPAN1Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
645 #define TPAN1StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 )
646 #define TPAN1StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_10 , Value )
647 /*** Functions for TPAN2 pin ***/
648 #define TPAN2Toggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
649 #define TPAN2On( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
650 #define TPAN2Off( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
651 #define TPAN2StateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 )
652 #define TPAN2StateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_11 , Value )
653 /*** Functions for FSK_DAC_CS pin ***/
654 #define FSK_DAC_CSToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
655 #define FSK_DAC_CSOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
656 #define FSK_DAC_CSOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
657 #define FSK_DAC_CSStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 )
658 #define FSK_DAC_CSStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_4 , Value )
659 /*** Functions for RLY_COMM pin ***/
660 #define RLY_COMMToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
661 #define RLY_COMMOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
662 #define RLY_COMMOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
663 #define RLY_COMMStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 )
664 #define RLY_COMMStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_14 , Value )
665 /*** Functions for FSK_DAC_CLR pin ***/
666 #define FSK_DAC_CLRToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
667 #define FSK_DAC_CLROn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
668 #define FSK_DAC_CLROff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
669 #define FSK_DAC_CLRStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 )
670 #define FSK_DAC_CLRStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_7 , Value )
671 /*** Functions for WL_CPS_SW pin ***/
672 #define WL_CPS_SWToggle( ) PLIB_PORTS_PinToggle ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
673 #define WL_CPS_SWOn( ) PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
674 #define WL_CPS_SWOff( ) PLIB_PORTS_PinClear ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
675 #define WL_CPS_SWStateGet( ) PLIB_PORTS_PinGetLatched ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 )
676 #define WL_CPS_SWStateSet( Value ) PLIB_PORTS_PinWrite ( PORTS_ID_0 , PORT_CHANNEL_G , PORTS_BIT_POS_13 , Value )
677 /*** Functions for HVPS_SW pin ***/
678 #define HVPS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_5 )
679 /*** Functions for MAN_SIG pin ***/
680 #define MAN_SIGStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_A , PORTS_BIT_POS_0 )
681 /*** Functions for DMP_FIRE_SW pin ***/
682 #define DMP_FIRE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_E , PORTS_BIT_POS_8 )
683 /*** Functions for NEG_SW pin ***/
684 #define NEG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_4 )
685 /*** Functions for POS_SW pin ***/
686 #define POS_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_15 )
687 /*** Functions for DRUM1_SW pin ***/
688 #define DRUM1_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_2 )
689 /*** Functions for SAFE_SW pin ***/
690 #define SAFE_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_1 )
691 /*** Functions for DRUM2_SW pin ***/
692 #define DRUM2_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_0 )
693 /*** Functions for LOG_SW pin ***/
694 #define LOG_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_3 )
695 /*** Functions for AUX_SW pin ***/
696 #define AUX_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_B , PORTS_BIT_POS_8 )
697 /*** Functions for ARMCF_SW pin ***/
698 #define ARMCF_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_1 )
699 /*** Functions for ARM_SW pin ***/
700 #define ARM_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_K , PORTS_BIT_POS_2 )
701 /*** Functions for ARMCF_AUTO_SW pin ***/
702 #define ARMCF_AUTO_SWStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_13 )
703 /*** Functions for FIRE_SW_OFF pin ***/
704 #define FIRE_SW_OFFStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_F , PORTS_BIT_POS_8 )
705 /*** Functions for FIRE_SW_ON pin ***/
706 #define FIRE_SW_ONStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_8 )
707 /*** Functions for WL_SPS_POS_DET pin ***/
708 #define WL_SPS_POS_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_12 )
709 /*** Functions for WL_SPS_NEG_DET pin ***/
710 #define WL_SPS_NEG_DETStateGet( ) PLIB_PORTS_PinGet ( PORTS_ID_0 , PORT_CHANNEL_H , PORTS_BIT_POS_13 )
711 #define MAN_CN_PORT_CHANNEL PORT_CHANNEL_A
712 #define MAN_CN_PORT_BIT PORTS_BIT_POS_0
713 #define MAN_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_A
714 #define HVPS_CN_PORT_CHANNEL PORT_CHANNEL_J
715 #define HVPS_CN_PORT_BIT PORTS_BIT_POS_11
716 #define HVPS_CN_PORT_INTERRUPT INT_SOURCE_CHANGE_NOTICE_J
717 /*** Application Instance 0 Configuration ***/
718 //DOM-IGNORE-BEGIN
719 //DOM-IGNORE-END
720  // _SYSTEM_CONFIG_H
721 /*******************************************************************************
722  End of File
723 */
724 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h*/
725 /* CLOSE_FILE Include File */
726 
727 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h */
728 /*******************************************************************************
729  System Definitions
730  File Name:
731  system_definitions.h
732  Summary:
733  MPLAB Harmony project system definitions.
734  Description:
735  This file contains the system-wide prototypes and definitions for an MPLAB
736  Harmony project.
737  *******************************************************************************/
738 //DOM-IGNORE-BEGIN
739 /*******************************************************************************
740 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
741 Microchip licenses to you the right to use, modify, copy and distribute
742 Software only when embedded on a Microchip microcontroller or digital signal
743 controller that is integrated into your product or third party product
744 (pursuant to the sublicense terms in the accompanying license agreement).
745 You should refer to the license agreement accompanying this Software for
746 additional information regarding your rights and obligations.
747 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
748 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
749 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
750 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
751 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
752 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
753 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
754 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
755 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
756 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
757  *******************************************************************************/
758 //DOM-IGNORE-END
759 #ifndef _SYS_DEFINITIONS_H
760 #define _SYS_DEFINITIONS_H
761 // *****************************************************************************
762 // *****************************************************************************
763 // Section: Included Files
764 // *****************************************************************************
765 // *****************************************************************************
766 #include <stdint.h>
767 #include <stddef.h>
768 #include <stdbool.h>
769 #include "system/common/sys_common.h"
770 #include "system/common/sys_module.h"
771 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h */
772 /*******************************************************************************
773  Input Capture Driver Interface Declarations for Static Single Instance Driver
774  Company:
775  Microchip Technology Inc.
776  File Name:
777  help_drv_ic.h
778  Summary:
779  Input Capture driver interface declarations for the static single instance
780  driver.
781  Description:
782  The Input Capture device driver provides a simple interface to manage the
783  Input Capture modules on Microchip microcontrollers. This file defines
784  the interface declarations for the IC driver.
785 
786  Remarks:
787  Static interfaces incorporate the driver instance number within the names
788  of the routines, eliminating the need for an object ID or object handle.
789 
790  Static single-open interfaces also eliminate the need for the open handle.
791 *******************************************************************************/
792 //DOM-IGNORE-BEGIN
793 /*******************************************************************************
794 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
795 Microchip licenses to you the right to use, modify, copy and distribute
796 Software only when embedded on a Microchip microcontroller or digital signal
797 controller that is integrated into your product or third party product
798 (pursuant to the sublicense terms in the accompanying license agreement).
799 You should refer to the license agreement accompanying this Software for
800 additional information regarding your rights and obligations.
801 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
802 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
803 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
804 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
805 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
806 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
807 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
808 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
809 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
810 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
811 *******************************************************************************/
812 //DOM-IGNORE-END
813 #ifndef _DRV_IC_H
814 #define _DRV_IC_H
815 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
816 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\driver_common.h */
817 /*******************************************************************************
818  Driver Common Header Definitions
819  Company:
820  Microchip Technology Inc.
821  File Name:
822  drv_common.h
823  Summary:
824  This file defines the common macros and definitions used by the driver
825  definition and implementation headers.
826  Description:
827  This file defines the common macros and definitions used by the driver
828  definition and the implementation header.
829  Remarks:
830  The directory in which this file resides should be added to the compiler's
831  search path for header files.
832  *******************************************************************************/
833 //DOM-IGNORE-BEGIN
834 /*******************************************************************************
835 Copyright (c) 2010-2013 released Microchip Technology Inc. All rights reserved.
836 Microchip licenses to you the right to use, modify, copy and distribute
837 Software only when embedded on a Microchip microcontroller or digital signal
838 controller that is integrated into your product or third party product
839 (pursuant to the sublicense terms in the accompanying license agreement).
840 You should refer to the license agreement accompanying this Software for
841 additional information regarding your rights and obligations.
842 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS-IS WITHOUT WARRANTY OF ANY KIND,
843 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
844 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
845 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
846 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
847 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
848 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
849 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
850 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
851 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
852  *******************************************************************************/
853 //DOM-IGNORE-END
854 #ifndef _DRV_COMMON_H
855 #define _DRV_COMMON_H
856 #include <stdint.h>
857 #include <stddef.h>
858 // *****************************************************************************
859 /* Device Driver I/O Intent
860  Summary:
861  Identifies the intended usage of the device when it is opened.
862  Description:
863  This enumeration identifies the intended usage of the device when the
864  caller opens the device. It identifies the desired behavior of the device
865  driver for the following:
866  * Blocking or non-blocking I/O behavior (do I/O calls such as read and write
867  block until the operation is finished or do they return immediately and
868  require the caller to call another routine to check the status of the
869  operation)
870  * Support reading and/or writing of data from/to the device
871  * Identify the buffering behavior (sometimes called "double buffering" of
872  the driver. Indicates if the driver should maintain its own read/write
873  buffers and copy data to/from these buffers to/from the caller's buffers.
874  * Identify the DMA behavior of the peripheral
875  Remarks:
876  The buffer allocation method is not identified by this enumeration. Buffers
877  can be allocated statically at build time, dynamically at run-time, or
878  even allocated by the caller and passed to the driver for its own usage if
879  a driver-specific routine is provided for such. This choice is left to
880  the design of the individual driver and is considered part of its
881  interface.
882  These values can be considered "flags". One selection from each of the
883  groups below can be ORed together to create the complete value passed
884  to the driver's open routine.
885 */
886 
887 typedef
888  enum
889  {
890  /* Read */
891  DRV_IO_INTENT_READ /*DOM-IGNORE-BEGIN*/
892  = 1 << 0 /* DOM-IGNORE-END*/
893  ,
894  /* Write */
895  DRV_IO_INTENT_WRITE /*DOM-IGNORE-BEGIN*/
896  = 1 << 1 /* DOM-IGNORE-END*/
897  ,
898  /* Read and Write*/
899  DRV_IO_INTENT_READWRITE /*DOM-IGNORE-BEGIN*/
900  = DRV_IO_INTENT_READ | DRV_IO_INTENT_WRITE /* DOM-IGNORE-END*/
901  ,
902  /* The driver will block and will return when the operation is complete */
903  DRV_IO_INTENT_BLOCKING /*DOM-IGNORE-BEGIN*/
904  = 0 << 2 /* DOM-IGNORE-END*/
905  ,
906  /* The driver will return immediately */
907  DRV_IO_INTENT_NONBLOCKING /*DOM-IGNORE-BEGIN*/
908  = 1 << 2 /* DOM-IGNORE-END*/
909  ,
910  /* The driver will support only one client at a time */
911  DRV_IO_INTENT_EXCLUSIVE /*DOM-IGNORE-BEGIN*/
912  = 1 << 3 /* DOM-IGNORE-END*/
913  ,
914  /* The driver will support multiple clients at a time */
915  DRV_IO_INTENT_SHARED /*DOM-IGNORE-BEGIN*/
916  = 0 << 3 /* DOM-IGNORE-END*/
917  } DRV_IO_INTENT ;
918 // *****************************************************************************
919 /* Driver Client Status
920  Summary:
921  Identifies the current status/state of a client's connection to a driver.
922  Description:
923  This enumeration identifies the current status/state of a client's link to
924  a driver.
925  Remarks:
926  The enumeration used as the return type for the client-level status routines
927  defined by each device driver or system module (for example,
928  DRV_USART_ClientStatus) must be based on the values in this enumeration.
929 */
930 
931 typedef
932  enum
933  {
934  /* Indicates that a driver-specific error has occurred. */
936  /* An unspecified error has occurred.*/
938  /* The driver is closed, no operations for this client are ongoing,
939  and/or the given handle is invalid. */
941  /* The driver is currently busy and cannot start additional operations. */
943  /* The module is running and ready for additional operations */
945  /* Indicates that the module is in a driver-specific ready/run state. */
948 // *****************************************************************************
949 /* Device Driver Blocking Status Macro
950  Summary:
951  Returns if the I/O intent provided is blocking
952  Description:
953  This macro returns if the I/O intent provided is blocking.
954  Remarks:
955  None.
956 */
957 #define DRV_IO_ISBLOCKING( intent ) ( intent & DRV_IO_INTENT_BLOCKING )
958 // *****************************************************************************
959 /* Device Driver Non Blocking Status Macro
960  Summary:
961  Returns if the I/O intent provided is non-blocking.
962  Description:
963  This macro returns if the I/ intent provided is non-blocking.
964  Remarks:
965  None.
966 */
967 #define DRV_IO_ISNONBLOCKING( intent ) ( intent & DRV_IO_INTENT_NONBLOCKING )
968 // *****************************************************************************
969 /* Device Driver Exclusive Status Macro
970  Summary:
971  Returns if the I/O intent provided is non-blocking.
972  Description:
973  This macro returns if the I/O intent provided is non-blocking.
974  Remarks:
975  None.
976 */
977 #define DRV_IO_ISEXCLUSIVE( intent ) ( intent & DRV_IO_INTENT_EXCLUSIVE )
978 // *****************************************************************************
979 /* Device Driver IO Buffer Identifier
980  Summary:
981  Identifies to which buffer a device operation will apply.
982  Description:
983  This enumeration identifies to which buffer (read, write, both, or neither)
984  a device operation will apply. This is used for "flush" (or similar)
985  operations.
986 */
987 
988 typedef
989  enum
990  {
991  // Operation does not apply to any buffer
993  // Operation applies to read buffer
995  // Operation applies to write buffer
997  // Operation applies to both read and write buffers
1000 // *****************************************************************************
1001 /* Device Handle
1002  Summary:
1003  Handle to an opened device driver.
1004  Description:
1005  This handle identifies the open instance of a device driver. It must be
1006  passed to all other driver routines (except the initialization, deinitialization,
1007  or power routines) to identify the caller.
1008  Remarks:
1009  Every application or module that wants to use a driver must first call
1010  the driver's open routine. This is the only routine that is absolutely
1011  required for every driver.
1012  If a driver is unable to allow an additional module to use it, it must then
1013  return the special value DRV_HANDLE_INVALID. Callers should check the
1014  handle returned for this value to ensure this value was not returned before
1015  attempting to call any other driver routines using the handle.
1016 */
1017 
1018 typedef
1019 uintptr_t
1021 // *****************************************************************************
1022 /* Invalid Device Handle
1023  Summary:
1024  Invalid device handle.
1025  Description:
1026  If a driver is unable to allow an additional module to use it, it must then
1027  return the special value DRV_HANDLE_INVALID. Callers should check the
1028  handle returned for this value to ensure this value was not returned before
1029  attempting to call any other driver routines using the handle.
1030  Remarks:
1031  None.
1032 */
1033 #define DRV_HANDLE_INVALID ( ( ( DRV_HANDLE ) - 1 ) )
1034 // *****************************************************************************
1035 /* Not supported configuration
1036  Summary:
1037  Not supported configuration.
1038  Description:
1039  If the configuration option is not supported on an instance of the
1040  peripheral, use this macro to equate to that configuration. This option
1041  should be listed as a possible value in the description of that
1042  configuration option.
1043 */
1044 #define DRV_CONFIG_NOT_SUPPORTED ( ( ( unsigned short ) - 1 ) )
1045 // *****************************************************************************
1046 /* Unsupported Attribute Abstraction
1047  Summary:
1048  Abstracts the use of the unsupported attribute defined by the compiler.
1049  Description:
1050  This macro nulls the definition of the _PLIB_UNSUPPORTED macro, to support
1051  compilation of the drivers for all different variants.
1052  Example:
1053  void _PLIB_UNSUPPORTED PLIB_USART_Enable(USART_MODULE_ID index);
1054  This function will not generate a compiler error if the interface is not
1055  defined for the selected device.
1056  Remarks:
1057  None.
1058 */
1059 #define _PLIB_UNSUPPORTED
1060  //_DRV_COMMON_H
1061 /*******************************************************************************
1062  End of File
1063 */
1064 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\driver_common.h*/
1065 /* CLOSE_FILE Include File */
1066 
1067 #include "system/common/sys_module.h"
1068 // *****************************************************************************
1069 /* IC Driver Module Index Numbers
1070  Summary:
1071  IC driver index definitions.
1072  Description:
1073  These constants provide IC Driver index definitions.
1074  Remarks:
1075  These constants should be used in place of hard-coded numeric literals.
1076  These values should be passed into the DRV_IC_Initialize and
1077  DRV_IC_Open routines to identify the driver instance in use.
1078 */
1079 #define DRV_IC_INDEX_0 0
1080 #define DRV_IC_INDEX_1 1
1081 #define DRV_IC_INDEX_2 2
1082 #define DRV_IC_INDEX_3 3
1083 #define DRV_IC_INDEX_4 4
1084 #define DRV_IC_INDEX_5 5
1085 #define DRV_IC_INDEX_6 6
1086 #define DRV_IC_INDEX_7 7
1087 #define DRV_IC_INDEX_8 8
1088 #define DRV_IC_INDEX_9 9
1089 #define DRV_IC_INDEX_10 10
1090 #define DRV_IC_INDEX_11 11
1091 #define DRV_IC_INDEX_12 12
1092 #define DRV_IC_INDEX_13 13
1093 #define DRV_IC_INDEX_14 14
1094 #define DRV_IC_INDEX_15 15
1095 // *****************************************************************************
1096 // *****************************************************************************
1097 // Section: Interface Headers for the static driver
1098 // *****************************************************************************
1099 // *****************************************************************************
1100 // *****************************************************************************
1101 /* Function:
1102  SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index,
1103  const SYS_MODULE_INIT * const init);
1104  Summary:
1105  Initializes the Input Capture instance for the specified driver index.
1106  <p><b>Implementation:</b> Static</p>
1107  Description:
1108  This routine initializes the Input Capture driver instance for the specified
1109  driver instance, making it ready for clients to use it. The initialization
1110  routine is specified by the MHC parameters. The driver instance index is
1111  independent of the Input Capture module ID. For example, driver instance 0
1112  can be assigned to Input Capture 2.
1113  Precondition:
1114  None.
1115  Parameters:
1116  None.
1117  Returns:
1118  None.
1119  Remarks:
1120  This routine must be called before any other Input Capture routine is called.
1121  This routine should only be called once during system initialization.
1122 */
1123 
1124 SYS_MODULE_OBJ
1126  const SYS_MODULE_INDEX index ,
1127  const SYS_MODULE_INIT * const init ) ;
1128 // *****************************************************************************
1129 /* Function:
1130 DRV_HANDLE DRV_IC_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1131  Summary:
1132  Opens the Input Capture instance for the specified driver index.
1133  <p><b>Implementation:</b> Static</p>
1134  Description:
1135  This routine starts the Input Capture driver for the specified driver
1136  index, starting an input capture.
1137  Precondition:
1138  DRV_IC_Initialize has been called.
1139  Parameters:
1140  None.
1141  Returns:
1142  None.
1143  Remarks:
1144  None.
1145 */
1146 
1147 DRV_HANDLE
1148  DRV_IC_Open (
1149  const SYS_MODULE_INDEX drvIndex ,
1150  const DRV_IO_INTENT intent ) ;
1151 // *****************************************************************************
1152 /* Function:
1153  void DRV_IC_Close(DRV_HANDLE handle)
1154  Summary:
1155  Closes the Input Capture instance for the specified driver index.
1156  <p><b>Implementation:</b> Static</p>
1157  Description:
1158  This routine stops the Input Capture driver for the specified driver
1159  index, stopping an input capture.
1160  Precondition:
1161  DRV_IC_Initialize has been called.
1162  Parameters:
1163  None.
1164  Returns:
1165  None.
1166  Remarks:
1167  None.
1168 */
1169 
1170 void
1171  DRV_IC_Close (
1172  DRV_HANDLE handle ) ;
1173 // *****************************************************************************
1174 /* Function:
1175 DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
1176  Summary:
1177  Starts the Input Capture instance for the specified driver index.
1178  <p><b>Implementation:</b> Static</p>
1179  Description:
1180  This routine starts the Input Capture driver for the specified driver
1181  index, starting an input capture.
1182  Precondition:
1183  DRV_IC_Initialize has been called.
1184  Parameters:
1185  None.
1186  Returns:
1187  None.
1188  Remarks:
1189  None.
1190 */
1191 
1192 DRV_HANDLE
1193  DRV_IC_Start (
1194  const SYS_MODULE_INDEX drvIndex ,
1195  const DRV_IO_INTENT intent ) ;
1196 // *****************************************************************************
1197 /* Function:
1198  void DRV_IC_Stop(DRV_HANDLE handle)
1199  Summary:
1200  Stops the Input Capture instance for the specified driver index.
1201  <p><b>Implementation:</b> Static</p>
1202  Description:
1203  This routine stops the Input Capture driver for the specified driver
1204  index, stopping an input capture.
1205  Precondition:
1206  DRV_IC_Initialize has been called.
1207  Parameters:
1208  None.
1209  Returns:
1210  None.
1211  Remarks:
1212  None.
1213 */
1214 
1215 void
1216  DRV_IC_Stop (
1217  DRV_HANDLE handle ) ;
1218 // *****************************************************************************
1219 /* Function:
1220  uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
1221  Summary:
1222  Reads the 32-bit Input Capture for the specified driver index.
1223  <p><b>Implementation:</b> Static</p>
1224  Description:
1225  This routine reads the 32-bit data for the specified driver index
1226  Precondition:
1227  DRV_IC_Initialize has been called.
1228  Parameters:
1229  None.
1230  Returns:
1231  uint32_t value of the data read from the Input Capture.
1232  Remarks:
1233  None.
1234 */
1235 
1236 uint32_t
1238  DRV_HANDLE handle ) ;
1239 // *****************************************************************************
1240 /* Function:
1241  uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
1242  Summary:
1243  Reads the 16-bit Input Capture for the specified driver index.
1244  <p><b>Implementation:</b> Static</p>
1245  Description:
1246  This routine reads the 16-bit data for the specified driver index.
1247  Precondition:
1248  DRV_IC_Initialize has been called.
1249  Parameters:
1250  None.
1251  Returns:
1252  uint16_t value of the data read from the Input Capture.
1253  Remarks:
1254  None.
1255 */
1256 
1257 uint16_t
1259  DRV_HANDLE handle ) ;
1260 // *****************************************************************************
1261 /* Function:
1262  bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
1263  Summary:
1264  Returns the Input Capture instance buffer empty status for the specified driver
1265  index.
1266  <p><b>Implementation:</b> Static</p>
1267  Description:
1268  Returns the Input Capture instance buffer empty status for the specified driver
1269  index. The function should be called to determine whether or not the IC buffer
1270  has data.
1271  Precondition:
1272  DRV_IC_Initialize has been called.
1273  Parameters:
1274  None.
1275  Returns:
1276  Boolean
1277  - 1 - Buffer is empty
1278  - 0 - Buffer is not empty
1279  Remarks:
1280  None.
1281 */
1282 
1283 bool
1285  DRV_HANDLE handle ) ;
1286 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h */
1287 /*******************************************************************************
1288  IC Driver Interface Declarations for Static Single Instance Driver
1289  Company:
1290  Microchip Technology Inc.
1291  File Name:
1292  drv_ic_static.h
1293  Summary:
1294  IC driver interface declarations for the static single instance driver.
1295  Description:
1296  The IC device driver provides a simple interface to manage the IC
1297  modules on Microchip microcontrollers. This file defines the interface
1298  Declarations for the IC driver.
1299 
1300  Remarks:
1301  Static interfaces incorporate the driver instance number within the names
1302  of the routines, eliminating the need for an object ID or object handle.
1303 
1304  Static single-open interfaces also eliminate the need for the open handle.
1305 *******************************************************************************/
1306 //DOM-IGNORE-BEGIN
1307 /*******************************************************************************
1308 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1309 Microchip licenses to you the right to use, modify, copy and distribute
1310 Software only when embedded on a Microchip microcontroller or digital signal
1311 controller that is integrated into your product or third party product
1312 (pursuant to the sublicense terms in the accompanying license agreement).
1313 You should refer to the license agreement accompanying this Software for
1314 additional information regarding your rights and obligations.
1315 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1316 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1317 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1318 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1319 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1320 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1321 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1322 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1323 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1324 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1325 *******************************************************************************/
1326 //DOM-IGNORE-END
1327 #ifndef _DRV_IC_STATIC_H
1328 #define _DRV_IC_STATIC_H
1329 #define DRV_IC_Open( drvIndex , intent ) ( drvIndex )
1330 #define DRV_IC_Close( handle )
1331 // *****************************************************************************
1332 // *****************************************************************************
1333 // Section: Interface Headers for Instance 0 for the static driver
1334 // *****************************************************************************
1335 // *****************************************************************************
1336 
1337 void
1338  DRV_IC0_Initialize ( void ) ;
1339 
1340 void
1341  DRV_IC0_Start ( void ) ;
1342 
1343 void
1344  DRV_IC0_Stop ( void ) ;
1345 
1346 uint32_t
1347  DRV_IC0_Capture32BitDataRead ( void ) ;
1348 
1349 uint16_t
1350  DRV_IC0_Capture16BitDataRead ( void ) ;
1351 
1352 bool
1353  DRV_IC0_BufferIsEmpty ( void ) ;
1354  // #ifndef _DRV_IC_STATIC_H
1355 /*******************************************************************************
1356  End of File
1357 */
1358 
1359 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\ic\drv_ic_static.h*/
1360 /* CLOSE_FILE Include File */
1361 
1362  // #ifndef _DRV_IC_H
1363 /*******************************************************************************
1364  End of File
1365 */
1366 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\ic\drv_ic.h*/
1367 /* CLOSE_FILE Include File */
1368 
1369 #include "system/devcon/sys_devcon.h"
1370 #include "system/clk/sys_clk.h"
1371 #include "system/int/sys_int.h"
1372 #include "system/tmr/sys_tmr.h"
1373 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h */
1374 /*******************************************************************************
1375  ADC Driver Interface Declarations for Static Single Instance Driver
1376  Company:
1377  Microchip Technology Inc.
1378  File Name:
1379  drv_adc_static.h
1380  Summary:
1381  ADC driver interface declarations for the static single instance driver.
1382  Description:
1383  The ADC device driver provides a simple interface to manage the ADC
1384  modules on Microchip microcontrollers. This file defines the interface
1385  Declarations for the ADC driver.
1386 
1387  Remarks:
1388  Static interfaces incorporate the driver instance number within the names
1389  of the routines, eliminating the need for an object ID or object handle.
1390 
1391  Static single-open interfaces also eliminate the need for the open handle.
1392 *******************************************************************************/
1393 //DOM-IGNORE-BEGIN
1394 /*******************************************************************************
1395 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
1396 Microchip licenses to you the right to use, modify, copy and distribute
1397 Software only when embedded on a Microchip microcontroller or digital signal
1398 controller that is integrated into your product or third party product
1399 (pursuant to the sublicense terms in the accompanying license agreement).
1400 You should refer to the license agreement accompanying this Software for
1401 additional information regarding your rights and obligations.
1402 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1403 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1404 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1405 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1406 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1407 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1408 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1409 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1410 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1411 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1412 *******************************************************************************/
1413 //DOM-IGNORE-END
1414 #ifndef _DRV_ADC_STATIC_H
1415 #define _DRV_ADC_STATIC_H
1416 #include <stdbool.h>
1417 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1418 #include "peripheral/adchs/plib_adchs.h"
1419 #include "peripheral/int/plib_int.h"
1420 
1421 typedef
1422  enum
1423  {
1424  DRV_ADC_ID_1 = ADCHS_ID_0 ,
1426  } DRV_ADC_MODULE_ID ;
1427 // *****************************************************************************
1428 // *****************************************************************************
1429 // Section: Interface Headers for ADC Static Driver
1430 // *****************************************************************************
1431 // *****************************************************************************
1432 
1433 void
1434  DRV_ADC_Initialize ( void ) ;
1435 
1436 inline void
1437  DRV_ADC_DeInitialize ( void ) ;
1438 
1439 inline void
1440  DRV_ADC0_Open ( void ) ;
1441 
1442 inline void
1443  DRV_ADC0_Close ( void ) ;
1444 
1445 inline void
1446  DRV_ADC1_Open ( void ) ;
1447 
1448 inline void
1449  DRV_ADC1_Close ( void ) ;
1450 
1451 inline void
1452  DRV_ADC_Start ( void ) ;
1453 
1454 inline void
1455  DRV_ADC_Stop ( void ) ;
1456 
1457 uint32_t
1459  uint8_t bufIndex ) ;
1460 
1461 bool
1463  uint8_t bufIndex ) ;
1464  // #ifndef _DRV_ADC_STATIC_H
1465 /*******************************************************************************
1466  End of File
1467 */
1468 
1469 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\adc\drv_adc_static.h*/
1470 /* CLOSE_FILE Include File */
1471 
1472 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h */
1473 /*******************************************************************************
1474  Timer Driver Interface Declarations for Static Single Instance Driver
1475  Company:
1476  Microchip Technology Inc.
1477  File Name:
1478  drv_tmr_static.h
1479  Summary:
1480  Timer driver interface declarations for the static single instance driver.
1481  Description:
1482  The Timer device driver provides a simple interface to manage the Timer
1483  modules on Microchip microcontrollers. This file defines the interface
1484  Declarations for the TMR driver.
1485 
1486  Remarks:
1487  Static interfaces incorporate the driver instance number within the names
1488  of the routines, eliminating the need for an object ID or object handle.
1489 
1490  Static single-open interfaces also eliminate the need for the open handle.
1491 *******************************************************************************/
1492 //DOM-IGNORE-BEGIN
1493 /*******************************************************************************
1494 Copyright (c) 2014 released Microchip Technology Inc. All rights reserved.
1495 Microchip licenses to you the right to use, modify, copy and distribute
1496 Software only when embedded on a Microchip microcontroller or digital signal
1497 controller that is integrated into your product or third party product
1498 (pursuant to the sublicense terms in the accompanying license agreement).
1499 You should refer to the license agreement accompanying this Software for
1500 additional information regarding your rights and obligations.
1501 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1502 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1503 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTOCULAR PURPOSE.
1504 IN NO EVENT SHALL MOCROCHIP OR ITS LOCENSORS BE LIABLE OR OBLIGATED UNDER
1505 CONTRACT, NEGLIGENCE, STROCT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1506 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1507 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1508 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1509 SUBSTITUTE GOODS, TECHNOLOGY, SERVOCES, OR ANY CLAIMS BY THIRD PARTIES
1510 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1511 *******************************************************************************/
1512 //DOM-IGNORE-END
1513 #ifndef _DRV_TMR_STATIC_H
1514 #define _DRV_TMR_STATIC_H
1515 // *****************************************************************************
1516 // *****************************************************************************
1517 // Section: Include Headers
1518 // *****************************************************************************
1519 // *****************************************************************************
1520 #include <stdint.h>
1521 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h */
1522 /*******************************************************************************
1523  Timer Device Driver Interface Definition
1524  Company:
1525  Microchip Technology Inc.
1526  File Name:
1527  drv_tmr.h
1528  Summary:
1529  Timer device driver interface header file.
1530  Description:
1531  This header file contains the function prototypes and definitions of the
1532  data types and constants that make up the interface to the Timer device
1533  driver.
1534 *******************************************************************************/
1535 //DOM-IGNORE-BEGIN
1536 /*******************************************************************************
1537 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1538 Microchip licenses to you the right to use, modify, copy and distribute
1539 Software only when embedded on a Microchip microcontroller or digital signal
1540 controller that is integrated into your product or third party product
1541 (pursuant to the sublicense terms in the accompanying license agreement).
1542 You should refer to the license agreement accompanying this Software for
1543 additional information regarding your rights and obligations.
1544 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1545 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1546 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1547 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1548 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1549 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1550 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1551 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1552 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1553 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1554 *******************************************************************************/
1555 //DOM-IGNORE-END
1556 #ifndef _DRV_TMR_H
1557 #define _DRV_TMR_H
1558 // *****************************************************************************
1559 // *****************************************************************************
1560 // Section: File includes
1561 // *****************************************************************************
1562 // *****************************************************************************
1563 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
1564 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
1565 #include "peripheral/tmr/plib_tmr.h"
1566 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h */
1567 /*******************************************************************************
1568  Timer Device Driver Interface Definition
1569  Company:
1570  Microchip Technology Inc.
1571  File Name:
1572  tmr_definitions_pic32m.h
1573  Summary:
1574  Timer device driver definitions header file.
1575  Description:
1576  This header file contains the definitions of the
1577  data types and constants that make up the interface to the Timer device
1578  driver.
1579 *******************************************************************************/
1580 //DOM-IGNORE-BEGIN
1581 /*******************************************************************************
1582 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
1583 Microchip licenses to you the right to use, modify, copy and distribute
1584 Software only when embedded on a Microchip microcontroller or digital signal
1585 controller that is integrated into your product or third party product
1586 (pursuant to the sublicense terms in the accompanying license agreement).
1587 You should refer to the license agreement accompanying this Software for
1588 additional information regarding your rights and obligations.
1589 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
1590 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
1591 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
1592 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
1593 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
1594 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
1595 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
1596 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
1597 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
1598 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
1599 *******************************************************************************/
1600 //DOM-IGNORE-END
1601 #ifndef _TMR_DEFINITIONS_PIC32M_H
1602 #define _TMR_DEFINITIONS_PIC32M_H
1603 // DOM-IGNORE-BEGIN
1604 // DOM-IGNORE-END
1605 
1606 typedef
1607  enum
1608  {
1609  /* Clock input to the timer module is internal(Peripheral Clock) */
1611  /*DOM-IGNORE-BEGIN*/
1612  = 0x00 /*DOM-IGNORE-END*/
1613  ,
1614  /* Clock input to the timer module is from T1CK pin (external)
1615  with clock synchronization enabled */
1617  /*DOM-IGNORE-BEGIN*/
1618  = 0x01 /*DOM-IGNORE-END*/
1619  ,
1620  /* Clock input to the timer module is from T1CK pin (external)
1621  with clock synchronization disabled */
1623  /*DOM-IGNORE-BEGIN*/
1624  = 0x11 /*DOM-IGNORE-END*/
1625  ,
1626  /* Clock input to the timer module is from secondary oscillator (external)
1627  with clock synchronization enabled */
1629  /*DOM-IGNORE-BEGIN*/
1630  = 0x02 /*DOM-IGNORE-END*/
1631  ,
1632  /* Clock input to the timer module is from secondary oscillator (external)
1633  with clock synchronization disabled */
1635  /*DOM-IGNORE-BEGIN*/
1636  = 0x12 /*DOM-IGNORE-END*/
1637  ,
1638  /* Clock input to the timer module is from LPRC
1639  with clock synchronization enabled */
1641  /*DOM-IGNORE-BEGIN*/
1642  = 0x03 /*DOM-IGNORE-END*/
1643  ,
1644  /* Clock input to the timer module is from LPRC
1645  with clock synchronization disabled */
1647  /*DOM-IGNORE-BEGIN*/
1648  = 0x13 /*DOM-IGNORE-END*/
1650 //DOM-IGNORE-BEGIN
1651 //DOM-IGNORE-END
1652  // #ifndef _DRV_TMR_H
1653 /*******************************************************************************
1654  End of File
1655 */
1656 
1657 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\tmr_definitions_pic32m.h*/
1658 /* CLOSE_FILE Include File */
1659 
1660 #include "system/int/sys_int.h" // System Interrupt Definitions
1661 #include "system/clk/sys_clk.h"
1662 // DOM-IGNORE-BEGIN
1663 // DOM-IGNORE-END
1664 // *****************************************************************************
1665 // *****************************************************************************
1666 // Section: TMR Driver Data Types
1667 // *****************************************************************************
1668 // *****************************************************************************
1669 // *****************************************************************************
1670 /* Timer Driver Module Index Numbers
1671  Summary:
1672  Timer driver index definitions
1673  Description:
1674  These constants provide Timer driver index definitions.
1675  Remarks:
1676  These constants should be used in place of hard-coded numeric literals.
1677  These values should be passed into the DRV_TMR_Initialize and DRV_TMR_Open
1678  functions to identify the driver instance in use.
1679 */
1680 #define DRV_TMR_INDEX_0 0
1681 #define DRV_TMR_INDEX_1 1
1682 #define DRV_TMR_INDEX_2 2
1683 #define DRV_TMR_INDEX_3 3
1684 #define DRV_TMR_INDEX_4 4
1685 #define DRV_TMR_INDEX_5 5
1686 #define DRV_TMR_INDEX_6 6
1687 #define DRV_TMR_INDEX_7 7
1688 #define DRV_TMR_INDEX_8 8
1689 #define DRV_TMR_INDEX_9 9
1690 #define DRV_TMR_INDEX_10 10
1691 #define DRV_TMR_INDEX_11 11
1692 // *****************************************************************************
1693 /* Timer Driver Module Index Count
1694  Summary:
1695  Number of valid Timer driver indices.
1696  Description:
1697  This constant identifies Timer driver index definitions.
1698  Remarks:
1699  This constant should be used in place of hard-coded numeric literals.
1700  This value is device-specific.
1701 */
1702 #define DRV_TMR_INDEX_COUNT TMR_NUMBER_OF_MODULES
1703 // *****************************************************************************
1704 /* Timer Driver Client Status
1705  Summary:
1706  Identifies the client-specific status of the Timer driver
1707  Description:
1708  This enumeration identifies the client-specific status of the Timer driver.
1709  Remarks:
1710  None.
1711 */
1712 
1713 typedef
1714  enum
1715  {
1716  /* Driver is invalid (or unopened) state */
1718  /*DOM-IGNORE-BEGIN*/
1719  = DRV_CLIENT_STATUS_ERROR /*DOM-IGNORE-END*/
1720  ,
1721  /* An operation is currently in progress */
1723  /*DOM-IGNORE-BEGIN*/
1724  = DRV_CLIENT_STATUS_BUSY /*DOM-IGNORE-END*/
1725  ,
1726  /* Ready, no operations running */
1728  /*DOM-IGNORE-BEGIN*/
1729  = DRV_CLIENT_STATUS_READY + 0 /*DOM-IGNORE-END*/
1730  ,
1731  /* Timer started and running, processing transactions */
1733  /*DOM-IGNORE-BEGIN*/
1734  = DRV_CLIENT_STATUS_READY + 1 /*DOM-IGNORE-END*/
1736 // *****************************************************************************
1737 /* Timer Driver Clock sources
1738  Summary:
1739  Lists the clock sources available for timer driver.
1740  Description:
1741  This enumeration lists all the available clock sources for the timer
1742  hardware.
1743  Remarks:
1744  Not all modes are available on all devices.
1745  'Synchronization' may not be applicable for all the instances of the timer.
1746  The driver discards the Synchronization mode selected if it is not
1747  applicable for the selected hardware.
1748 */
1749 // *****************************************************************************
1750 /* Timer Driver Operation mode
1751  Summary:
1752  Lists the operation modes available for timer driver.
1753  Description:
1754  This enumeration lists all the available operation modes that are valid for
1755  the timer hardware.
1756  Remarks:
1757  Not all modes are available on all devices.
1758 */
1759 
1760 typedef
1761  enum
1762  {
1763  /* The timer module operating mode none/invalid */
1765  /* The timer module operates in 16 bit mode */
1767  /* The timer module operates in 32 bit mode */
1768  /* This will combine two 16 bit timer modules */
1771 // *****************************************************************************
1772 /* Timer Driver divider operating specification
1773  Summary:
1774  This data structure specifies the divider values that can be obtained by the
1775  timer module.
1776  Description:
1777  This data structure specifies the divider values that can be obtained by the
1778  timer hardware.
1779  Remarks:
1780  None.
1781 */
1782 
1783 typedef
1784  struct
1785  {
1786  /* The minimum divider value that the timer module can obtain */
1787  uint32_t dividerMin ;
1788  /* The maximum divider value that the timer module can obtain */
1789  uint32_t dividerMax ;
1790  /* The divider step value, between 2 divider values */
1791  /* Should be 1 for most timers */
1792  uint32_t dividerStep ;
1794 // *****************************************************************************
1795 /* Timer Driver Initialize Data
1796  Summary:
1797  Defines the Timer driver initialization data.
1798  Description:
1799  This data type defines data required to initialize the Timer driver.
1800  Remarks:
1801  Not all initialization features are available on all devices.
1802 */
1803 
1804 typedef
1805  struct
1806  {
1807  /* System module initialization. */
1808  SYS_MODULE_INIT moduleInit ;
1809  /* Identifies timer hardware module (PLIB-level) ID */
1810  TMR_MODULE_ID tmrId ;
1811  /* Clock Source select. */
1812  DRV_TMR_CLK_SOURCES clockSource ;
1813  /* Prescaler Selection from the processor enumeration */
1814  TMR_PRESCALE prescale ;
1815  /* Interrupt Source for TMR module. If 'DRV_TMR_OPERATION_MODE_32_BIT' flag
1816  is selected the interrupt will be generated by the 2nd timer of the pair,
1817  the odd numbered one. */
1818  INT_SOURCE interruptSource ;
1819  /* Select 16/32 bit operation mode. 32 bit mode will combine two 16 bit
1820  timer modules to form a 32 bit one. This is usually only necessary for
1821  very long delays. */
1822  DRV_TMR_OPERATION_MODE mode ;
1823  /* Asynchronous write enable configuration. If true the asynchronous write
1824  is enabled. For timers that do not support this feature the value is
1825  ignored */
1826  bool asyncWriteEnable ;
1827  } DRV_TMR_INIT ;
1828 // *****************************************************************************
1829 /* Timer Driver Callback Function Pointer
1830  Summary:
1831  Pointer to a Timer driver callback function data type.
1832  Description:
1833  This data type defines a pointer to a Timer driver callback function.
1834  Remarks:
1835  Useful only when timer alarm callback support is enabled by defining the
1836  DRV_TMR_ALARM_ENABLE configuration option.
1837 */
1838 
1839 typedef
1840 void ( * DRV_TMR_CALLBACK ) ( uintptr_t context ,
1841 uint32_t alarmCount ) ;
1842 // *****************************************************************************
1843 // *****************************************************************************
1844 // Section: Timer Driver Module Interface Functions
1845 // *****************************************************************************
1846 // *****************************************************************************
1847 // *****************************************************************************
1848 /* Function:
1849  SYS_MODULE_OBJ DRV_TMR_Initialize
1850  (
1851  const SYS_MODULE_INDEX drvIndex,
1852  const SYS_MODULE_INIT * const init
1853  )
1854  Summary:
1855  Initializes the Timer driver.
1856  <p><b>Implementation:</b> Static/Dynamic</p>
1857  Description:
1858  This function initializes the Timer driver, making it ready for clients to
1859  open and use it.
1860  Precondition:
1861  None.
1862  Parameters:
1863  drvIndex - Index for the driver instance to be initialized
1864  init - Pointer to a data structure containing any data necessary
1865  to initialize the driver.
1866  Returns:
1867  If successful, returns a valid handle to a driver object. Otherwise, it
1868  returns SYS_MODULE_OBJ_INVALID. The returned object must be passed as
1869  argument to DRV_TMR_Deinitialize, DRV_TMR_Tasks and DRV_TMR_Status functions.
1870  Example:
1871  <code>
1872  DRV_TMR_INIT init;
1873  SYS_MODULE_OBJ objectHandle;
1874  // Populate the timer initialization structure
1875  init.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
1876  init.tmrId = TMR_ID_2;
1877  init.clockSource = DRV_TMR_CLKSOURCE_INTERNAL;
1878  init.prescale = TMR_PRESCALE_VALUE_256;
1879  init.interruptSource = INT_SOURCE_TIMER_2;
1880  init.mode = DRV_TMR_OPERATION_MODE_16_BIT;
1881  init.asyncWriteEnable = false;
1882  // Do something
1883  objectHandle = DRV_TMR_Initialize ( DRV_TMR_INDEX_0, (SYS_MODULE_INIT*)&init );
1884  if ( SYS_MODULE_OBJ_INVALID == objectHandle )
1885  {
1886  // Handle error
1887  }
1888  </code>
1889  Remarks:
1890  This function must be called before any other Timer driver function is
1891  called.
1892  This function should only be called once during system initialization unless
1893  DRV_TMR_Deinitialize is called to deinitialize the driver instance.
1894  This function will NEVER block for hardware access. The system must use
1895  DRV_TMR_Status to find out when the driver is in the ready state.
1896  Build configuration options may be used to statically override options in
1897  the "init" structure and will take precedence over initialization data
1898  passed using this function.
1899 */
1900 
1901 SYS_MODULE_OBJ
1903  const SYS_MODULE_INDEX drvIndex ,
1904  const SYS_MODULE_INIT * const init ) ;
1905 // *****************************************************************************
1906 /* Function:
1907  void DRV_TMR_Deinitialize ( SYS_MODULE_OBJ object )
1908  Summary:
1909  Deinitializes the specified instance of the Timer driver.
1910  <p><b>Implementation:</b> Dynamic</p>
1911  Description:
1912  Deinitializes the specified instance of the Timer driver, disabling
1913  its operation (and any hardware). All internal data is invalidated.
1914  Precondition:
1915  The DRV_TMR_Initialize function must have been called before calling this
1916  function and a valid SYS_MODULE_OBJ must have been returned.
1917  Parameters:
1918  object - Driver object handle, returned from DRV_TMR_Initialize
1919  Returns:
1920  None.
1921  Example:
1922  <code>
1923  SYS_MODULE_OBJ tmrObject; // Returned from DRV_TMR_Initialize
1924  SYS_STATUS tmrStatus;
1925  DRV_TMR_Deinitialize ( tmrObject );
1926  tmrStatus = DRV_TMR_Status ( tmrObject );
1927  if ( SYS_MODULE_UNINITIALIZED == tmrStatus )
1928  {
1929  // Check again later if you need to know
1930  // when the driver is deinitialized.
1931  }
1932  </code>
1933  Remarks:
1934  Once the Initialize operation has been called, the Deinitialize operation
1935  must be called before the Initialize operation can be called again.
1936  This function will NEVER block waiting for hardware. If the operation
1937  requires time to allow the hardware to complete, this will be reported by
1938  the DRV_TMR_Status operation. The system has to use DRV_TMR_Status to find
1939  out when the module is in the ready state.
1940 */
1941 
1942 void
1944  SYS_MODULE_OBJ object ) ;
1945 // *****************************************************************************
1946 /* Function:
1947  SYS_STATUS DRV_TMR_Status ( SYS_MODULE_OBJ object )
1948  Summary:
1949  Provides the current status of the Timer driver.
1950  <p><b>Implementation:</b> Dynamic</p>
1951  Description:
1952  This function provides the current status of the Timer driver.
1953  Precondition:
1954  The DRV_TMR_Initialize function must have been called before calling this
1955  function.
1956  Parameters:
1957  object - Driver object handle, returned from DRV_TMR_Initialize
1958  Returns:
1959  SYS_STATUS_READY - Indicates that the driver is initialized and ready
1960  for operation
1961  Note: Any value greater than SYS_STATUS_READY is
1962  also a normal running state in which the driver
1963  is ready to accept new operations.
1964  SYS_STATUS_ERROR - Indicates that the driver is in an error state
1965  Note: Any value less than SYS_STATUS_ERROR is
1966  also an error state.
1967  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been deinitialized
1968  Note: This value is less than SYS_STATUS_ERROR.
1969  Example:
1970  <code>
1971  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
1972  SYS_STATUS tmrStatus;
1973  tmrStatus = DRV_TMR_Status ( object );
1974  else if ( SYS_STATUS_ERROR >= tmrStatus )
1975  {
1976  // Handle error
1977  }
1978  </code>
1979  Remarks:
1980  The this operation can be used to determine when any of the driver's module
1981  level operations has completed.
1982  Once the status operation returns SYS_STATUS_READY, the driver is ready for
1983  operation.
1984  The value of SYS_STATUS_ERROR is negative (-1). Any value less than that is
1985  also an error state.
1986  This function will NEVER block waiting for hardware.
1987 */
1988 
1989 SYS_STATUS
1990  DRV_TMR_Status (
1991  SYS_MODULE_OBJ object ) ;
1992 // *****************************************************************************
1993 /* Function:
1994  void DRV_TMR_Tasks ( SYS_MODULE_OBJ object )
1995  Summary:
1996  Maintains the driver's state machine.
1997  <p><b>Implementation:</b> Dynamic</p>
1998  Description:
1999  This function is used to maintain the driver's internal state machine and
2000  processes the timer events..
2001  Precondition:
2002  The DRV_TMR_Initialize function must have been called for the specified Timer
2003  driver instance.
2004  Parameters:
2005  object - Object handle for the specified driver instance (returned from
2006  DRV_TMR_Initialize)
2007  Returns:
2008  None
2009  Example:
2010  <code>
2011  SYS_MODULE_OBJ object; // Returned from DRV_TMR_Initialize
2012  while (true)
2013  {
2014  DRV_TMR_Tasks ( object );
2015  // Do other tasks
2016  }
2017  </code>
2018  Remarks:
2019  This function is normally not called directly by an application. It is
2020  called by the system's Tasks routine (SYS_Tasks)
2021 */
2022 
2023 void
2024  DRV_TMR_Tasks (
2025  SYS_MODULE_OBJ object ) ;
2026 // *****************************************************************************
2027 // *****************************************************************************
2028 // Section: TMR Driver Client Functions
2029 // *****************************************************************************
2030 // *****************************************************************************
2031 // *****************************************************************************
2032 /* Function:
2033  DRV_HANDLE DRV_TMR_Open
2034  (
2035  const SYS_MODULE_INDEX index,
2036  const DRV_IO_INTENT intent
2037  )
2038  Summary:
2039  Opens the specified Timer driver instance and returns a handle to it.
2040  <p><b>Implementation:</b> Dynamic</p>
2041  Description:
2042  This function opens the specified Timer driver instance and provides a
2043  handle that must be provided to all other client-level operations to
2044  identify the caller and the instance of the driver. Timer driver does not
2045  support multiple clients. If two tasks want to use the timer, one should
2046  wait until the other one gets closed.
2047  Precondition:
2048  The DRV_TMR_Initialize function must have been called before calling this
2049  function.
2050  Parameters:
2051  index - Identifier for the object instance to be opened
2052  intent - Zero or more of the values from the enumeration
2053  DRV_IO_INTENT ORed together to indicate the intended use
2054  of the driver
2055  Returns:
2056  If successful, the function returns a valid open instance handle (a number
2057  identifying both the caller and the module instance).
2058  If an error occurs, the return value is DRV_HANDLE_INVALID.
2059  Example:
2060  <code>
2061  DRV_HANDLE handle;
2062  handle = DRV_TMR_Open ( DRV_TMR_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
2063  if ( DRV_HANDLE_INVALID == handle )
2064  {
2065  // Unable to open the driver
2066  }
2067  </code>
2068  Remarks:
2069  The handle returned is valid until the DRV_TMR_Close function is called.
2070  This function will NEVER block waiting for hardware.
2071  If the requested intent flags are not supported, the function will return
2072  DRV_HANDLE_INVALID.
2073  The Timer driver does not support DRV_IO_INTENT_SHARED.
2074  Only exclusive access is supported for now.
2075 */
2076 
2077 DRV_HANDLE
2078  DRV_TMR_Open (
2079  const SYS_MODULE_INDEX index ,
2080  const DRV_IO_INTENT intent ) ;
2081 // *****************************************************************************
2082 /* Function:
2083  void DRV_TMR_Close ( DRV_HANDLE handle )
2084  Summary:
2085  Closes an opened instance of the Timer driver.
2086  <p><b>Implementation:</b> Dynamic</p>
2087  Description:
2088  This function closes an opened instance of the Timer driver, invalidating
2089  the handle.
2090  Precondition:
2091  The DRV_TMR_Initialize function must have been called for the specified
2092  Timer driver instance.
2093  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2094  Parameters:
2095  handle - A valid open-instance handle, returned from the driver's
2096  open routine
2097  Returns:
2098  None
2099  Example:
2100  <code>
2101  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2102  DRV_TMR_Close ( handle );
2103  </code>
2104  Remarks:
2105  After calling this function, the handle passed in "handle" must not be used
2106  with any of the remaining driver functions. A new handle must be obtained
2107  by calling DRV_TMR_Open before the caller may use the driver again.
2108  Note: Usually there is no need for the driver client to verify that the Close
2109  operation has completed.
2110 */
2111 
2112 void
2113  DRV_TMR_Close (
2114  DRV_HANDLE handle ) ;
2115 // *****************************************************************************
2116 /* Function:
2117  DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus ( DRV_HANDLE handle )
2118  Summary:
2119  Gets the status of the client operation.
2120  <p><b>Implementation:</b> Dynamic</p>
2121  Description:
2122  This function gets the status of the recently completed client level
2123  operation.
2124  Precondition:
2125  The DRV_TMR_Initialize function must have been called for the specified
2126  Timer driver instance.
2127  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2128  Parameters:
2129  handle - A valid open-instance handle, returned from the driver's
2130  open routine
2131  Returns:
2132  None
2133  Example:
2134  <code>
2135  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2136  DRV_TMR_CLIENT_STATUS tmrDrvStatus;
2137  tmrDrvStatus = DRV_TMR_ClientStatus ( tmrHandle );
2138  </code>
2139  Remarks:
2140  None.
2141 */
2142 
2145  DRV_HANDLE handle ) ;
2146 // *****************************************************************************
2147 // *****************************************************************************
2148 // Section: TMR Driver Counting functions
2149 // *****************************************************************************
2150 // *****************************************************************************
2151 // *****************************************************************************
2152 /* Function:
2153  void DRV_TMR_CounterValueSet ( DRV_HANDLE handle, uint32_t counterPeriod )
2154  Summary:
2155  Updates the Timer's counter register.
2156  <p><b>Implementation:</b> Static/Dynamic</p>
2157  Description:
2158  This function updates the Timer's value in the counter register.
2159  Precondition:
2160  The DRV_TMR_Initialize function must have been called.
2161  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2162  Parameters:
2163  handle - A valid open-instance handle, returned from the driver's
2164  open routine
2165  counterPeriod - counter period value
2166  - a 16 bit value if the timer is configured in 16 bit mode
2167  - a 32 bit value if the timer is configured in 32 bit mode
2168  Returns:
2169  None.
2170  Example:
2171  <code>
2172  </code>
2173  Remarks:
2174  None.
2175 */
2176 
2177 void
2179  DRV_HANDLE handle ,
2180  uint32_t counterPeriod ) ;
2181 // *****************************************************************************
2182 /* Function:
2183  uint32_t DRV_TMR_CounterValueGet ( DRV_HANDLE handle )
2184  Summary:
2185  Reads the Timer's counter register.
2186  <p><b>Implementation:</b> Static/Dynamic</p>
2187  Description:
2188  This function returns the Timer's value in the counter register.
2189  Precondition:
2190  The DRV_TMR_Initialize function must have been called.
2191  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2192  Parameters:
2193  handle - A valid open-instance handle, returned from the driver's
2194  open routine
2195  Returns:
2196  Timer current period:
2197  - a 16 bit value if the timer is configured in 16 bit mode
2198  - a 32 bit value if the timer is configured in 32 bit mode
2199  Example:
2200  <code>
2201  //Example to use timer for precision time measurement
2202  //without configuring an alarm (interrupt based)
2203  char appState = 0;
2204  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2205  switch ( appState )
2206  {
2207  case 0:
2208  //Calculate and set the counter period
2209  DRV_TMR_CounterValueSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2210  //counter starts
2211  DRV_TMR_Start ( tmrHandle );
2212  //Trigger an application operation
2213  app_trigger_operation();
2214  //Check for time-out in the next state
2215  appState++;
2216  case 1:
2217  //Overflows and stops at 0 if no alarm is set
2218  if ( DRV_TMR_CounterValueGet ( tmrHandle ) == 0 )
2219  {
2220  //Time-out
2221  return false;
2222  }
2223  else if ( app_operation_isComplete( ) )
2224  {
2225  //Operation is complete before time-out
2226  return true;
2227  }
2228  </code>
2229  Remarks:
2230  None.
2231 */
2232 
2233 uint32_t
2235  DRV_HANDLE handle ) ;
2236 // *****************************************************************************
2237 /* Function:
2238  void DRV_TMR_CounterClear ( DRV_HANDLE handle )
2239  Summary:
2240  Clears the Timer's counter register.
2241  <p><b>Implementation:</b> Static/Dynamic</p>
2242  Description:
2243  This function clears the Timer's value in the counter register.
2244  Precondition:
2245  The DRV_TMR_Initialize function must have been called.
2246  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2247  Parameters:
2248  handle - A valid open-instance handle, returned from the driver's
2249  open routine
2250  Returns:
2251  None.
2252  Example:
2253  <code>
2254  </code>
2255  Remarks:
2256  None.
2257 */
2258 
2259 void
2261  DRV_HANDLE handle ) ;
2262 // *****************************************************************************
2263 /* Function:
2264  bool DRV_TMR_AlarmRegister
2265  (
2266  DRV_HANDLE handle,
2267  uint32_t divider,
2268  bool isPeriodic,
2269  uintptr_t context,
2270  DRV_TMR_CALLBACK callBack
2271  )
2272  Summary:
2273  Sets up an alarm.
2274  <p><b>Implementation:</b> Dynamic</p>
2275  Description:
2276  This function sets up an alarm, allowing the client to receive a callback
2277  from the driver when the timer counter reaches zero. Alarms can be one-shot
2278  or periodic. A periodic alarm will reload the timer and generate alarm
2279  until stopped. The alarm frequency is: DRV_TMR_CounterFrequencyGet() /
2280  divider;
2281  Precondition:
2282  The DRV_TMR_Initialize function must have been called.
2283  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2284  divider value has to be within the timer divider range (see DRV_TMR_DividerSpecGet).
2285  Parameters:
2286  handle - A valid handle, returned from DRV_TMR_Open
2287  divider - The value to divide the timer clock source to obtain the
2288  required alarm frequency.
2289  - a 16 bit value if the timer is configured in 16 bit mode
2290  - a 32 bit value if the timer is configured in 32 bit mode
2291  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
2292  context - A reference, call back function will be called with the same
2293  reference.
2294  callBack - A call back function which will be called on time out.
2295  Returns:
2296  - true - if the call succeeded
2297  - false - the obtained divider could not be obtained or the passed handle was invalid
2298  Example:
2299  <code>
2300  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
2301  void setupTask ()
2302  {
2303  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2304  uint32_t myFreq = 1000; // 1KHz
2305  uint32_t clkFreq = DRV_TMR_CounterFrequencyGet(tmrHandle); // timer running frequency
2306  // calculate the divider needed
2307  uint32_t divider = clkFreq / myFreq;
2308  // Start the alarm
2309  if(!DRV_TMR_AlarmRegister ( tmrHandle, divider, true, 0, CallBackFreq ))
2310  {
2311  // divider value could not be obtain;
2312  // handle the error
2313  //
2314  }
2315  }
2316  </code>
2317  Remarks:
2318  The divider value will be truncated to a 16 bit value if the timer is
2319  configured in 16 bit mode. The timer should be started using DRV_TMR_Start API to get a
2320  callback.
2321 */
2322 
2323 bool
2325  DRV_HANDLE handle ,
2326  uint32_t divider ,
2327  bool isPeriodic ,
2328  uintptr_t context ,
2329  DRV_TMR_CALLBACK callBack ) ;
2330 // *****************************************************************************
2331 /* Function:
2332  bool DRV_TMR_AlarmDisable ( DRV_HANDLE handle);
2333  Summary:
2334  Disables an alarm signal.
2335  <p><b>Implementation:</b> Dynamic</p>
2336  Description:
2337  This function allows the client to disable an alarm generation.
2338  Use DRV_TMR_AlarmEnable to re-enable.
2339  Precondition:
2340  The DRV_TMR_Initialize function must have been called.
2341  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2342  A client alarm must be active.
2343  Parameters:
2344  handle - A valid handle, returned from DRV_TMR_Open
2345  Returns:
2346  The current status of the alarm:
2347  - true if the alarm was currently enabled
2348  - false if the alarm was currently disabled
2349  Example:
2350  <code>
2351  </code>
2352  Remarks:
2353  When the driver operates in interrupts this call resolves to a device
2354  interrupt disable.
2355  Do NOT disable the timer except for very short periods of time. If the time
2356  that the interrupt is disabled is longer than a wrap around period and the
2357  interrupt is missed, the hardware has no means of recovering and the
2358  resulting timing will be inaccurate.
2359 */
2360 
2361 bool
2363  DRV_HANDLE handle ) ;
2364 // *****************************************************************************
2365 /* Function:
2366  void DRV_TMR_AlarmEnable ( DRV_HANDLE handle, bool enable );
2367  Summary:
2368  Re-enables an alarm signal.
2369  <p><b>Implementation:</b> Dynamic</p>
2370  Description:
2371  This function allows the client to re-enable an alarm after it has been
2372  disabled by a DRV_TMR_AlarmDisable call.
2373  Precondition:
2374  The DRV_TMR_Initialize function must have been called.
2375  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2376  Parameters:
2377  handle - A valid handle, returned from DRV_TMR_Open
2378  enable - boolean to enable the current callback
2379  Returns:
2380  None
2381  Example:
2382  <code>
2383  </code>
2384  Remarks:
2385  When the driver operates in interrupts this call resolves to a device
2386  interrupt re-enable.
2387 */
2388 
2389 void
2391  DRV_HANDLE handle ,
2392  bool enable ) ;
2393 // *****************************************************************************
2394 /* Function:
2395  void DRV_TMR_AlarmPeriodSet ( DRV_HANDLE handle, uint32_t value )
2396  Summary:
2397  Updates the Timer's period.
2398  <p><b>Implementation:</b> Dynamic</p>
2399  Description:
2400  This function updates the Timer's period.
2401  Precondition:
2402  The DRV_TMR_Initialize function must have been called.
2403  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2404  Parameters:
2405  handle - A valid open-instance handle, returned from the driver's
2406  open routine
2407  value - Period value
2408  - a 16 bit value if the timer is configured in 16 bit mode
2409  - a 32 bit value if the timer is configured in 32 bit mode
2410  Returns:
2411  None.
2412  Example:
2413  <code>
2414  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2415  DRV_TMR_AlarmPeriodSet ( handle, 0x1000 );
2416  </code>
2417  Remarks:
2418  - The period value will be truncated to a 16 bit value if the timer is
2419  configured in 16 bit mode.
2420 */
2421 
2422 void
2424  DRV_HANDLE handle ,
2425  uint32_t value ) ;
2426 // *****************************************************************************
2427 /* Function:
2428  uint32_t DRV_TMR_AlarmPeriodGet ( DRV_HANDLE handle )
2429  Summary:
2430  Provides the Timer's period.
2431  <p><b>Implementation:</b> Dynamic</p>
2432  Description:
2433  This function gets the Timer's period.
2434  Precondition:
2435  The DRV_TMR_Initialize function must have been called.
2436  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2437  Parameters:
2438  handle - A valid open-instance handle, returned from the driver's
2439  open routine
2440  Returns:
2441  Timer period value:
2442  - a 16 bit value if the timer is configured in 16 bit mode
2443  - a 32 bit value if the timer is configured in 32 bit mode
2444  Example:
2445  <code>
2446  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2447  uint32_t period;
2448  period = DRV_TMR_AlarmPeriodGet ( tmrHandle );
2449  </code>
2450  Remarks:
2451  None.
2452 */
2453 
2454 uint32_t
2456  DRV_HANDLE handle ) ;
2457 // *****************************************************************************
2458 /* Function:
2459  void DRV_TMR_AlarmDeregister ( DRV_HANDLE handle )
2460  Summary:
2461  Removes a previously set alarm.
2462  <p><b>Implementation:</b> Dynamic</p>
2463  Description:
2464  This function removes a previously set alarm.
2465  Precondition:
2466  The DRV_TMR_Initialize function must have been called.
2467  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2468  DRV_TMR_AlarmRegister function must have been called before.
2469  Parameters:
2470  handle - A valid open-instance handle, returned from the driver's
2471  open routine
2472  Returns:
2473  None.
2474  Example:
2475  <code>
2476  // Example of a key debounce check
2477  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
2478  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2479  void keyPressDetect ()
2480  {
2481  // Calculate the count to be passed on from the clock input
2482  DRV_TMR_AlarmRegister ( tmrHandle, 0xFF00, true, DebounceCheck );
2483  }
2484  void DebounceCheck ( uintptr_t context )
2485  {
2486  readKey = AppReadKey();
2487  if ( readKey != lastReadKey )
2488  {
2489  lastReadKey = readKey;
2490  keyCount = 0;
2491  }
2492  else
2493  {
2494  if ( keyCount > 20 )
2495  {
2496  globalKeyState = readKey;
2497  DRV_TMR_AlarmDeregister ( tmrHandle );
2498  }
2499  keyCount++;
2500  }
2501  }
2502  </code>
2503  Remarks:
2504  None.
2505 */
2506 
2507 void
2509  DRV_HANDLE handle ) ;
2510 // *****************************************************************************
2511 // *****************************************************************************
2512 // Section: TMR Driver Operation Control Functions
2513 // *****************************************************************************
2514 // *****************************************************************************
2515 // *****************************************************************************
2516 /* Function:
2517  bool DRV_TMR_Start ( DRV_HANDLE handle )
2518  Summary:
2519  Starts the Timer counting.
2520  <p><b>Implementation:</b> Static/Dynamic</p>
2521  Description:
2522  This function starts the Timer counting.
2523  Precondition:
2524  The DRV_TMR_Initialize function must have been called.
2525  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2526  Timer parameters must have been set by a call to DRV_TMR_AlarmRegister.
2527  Parameters:
2528  handle - A valid open-instance handle, returned from the driver's
2529  open routine
2530  Returns:
2531  - true - if the operation succeeded
2532  - false - the supplied handle is invalid or the client doesn't have
2533  the needed parameters to run (alarm callback and period )
2534  Example:
2535  <code>
2536  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2537  DRV_TMR_AlarmRegister(tmrHandle, 0x100, true, 0, myTmrCallback);
2538  DRV_TMR_Start ( tmrHandle );
2539  </code>
2540  Remarks:
2541  None.
2542 */
2543 
2544 bool
2545  DRV_TMR_Start (
2546  DRV_HANDLE handle ) ;
2547 // *****************************************************************************
2548 /* Function:
2549  void DRV_TMR_Stop ( DRV_HANDLE handle )
2550  Summary:
2551  Stops the Timer from counting.
2552  <p><b>Implementation:</b> Static/Dynamic</p>
2553  Description:
2554  This function stops the running Timer from counting.
2555  Precondition:
2556  The DRV_TMR_Initialize function must have been called.
2557  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2558  Parameters:
2559  handle - A valid open-instance handle, returned from the driver's
2560  open routine
2561  Returns:
2562  None.
2563  Example:
2564  <code>
2565  DRV_HANDLE handle; // Returned from DRV_TMR_Open
2566  DRV_TMR_Stop ( handle );
2567  </code>
2568  Remarks:
2569  None.
2570 */
2571 
2572 void
2573  DRV_TMR_Stop (
2574  DRV_HANDLE handle ) ;
2575 // *****************************************************************************
2576 // *****************************************************************************
2577 // Section: TMR Driver Operation Status Functions
2578 // *****************************************************************************
2579 // *****************************************************************************
2580 // *****************************************************************************
2581 /* Function:
2582  unsigned int DRV_TMR_AlarmHasElapsed ( DRV_HANDLE handle )
2583  Summary:
2584  Provides the status of Timer's period elapse.
2585  <p><b>Implementation:</b> Dynamic</p>
2586  Description:
2587  This function returns the number of times Timer's period has elapsed since
2588  last call to this API has made. On calling this API, the internally
2589  maintained counter will be cleared and count will be started again from next
2590  elapse.
2591  Precondition:
2592  The DRV_TMR_Initialize function must have been called.
2593  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2594  Parameters:
2595  handle - A valid handle, returned from the DRV_TMR_Open
2596  Returns:
2597  Number of times timer has elapsed since the last call.
2598  Example:
2599  <code>
2600  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2601  bool elapseStatus;
2602  SYS_MODULE_OBJ tmrObject // Returned by DRV_TMR_Initialize
2603  unsigned int appInternalTime = 0;
2604  Sys_Tasks()
2605  {
2606  //Timer task will be called from ISR
2607  APP_TimeUpdate_Task();
2608  //Other Tasks
2609  }
2610  void APP_TimeUpdate_Task ( void )
2611  {
2612  //We will not miss a count even though we are late
2613  appInternalTime += DRV_TMR_AlarmHasElapsed ( tmrHandle );
2614  }
2615  </code>
2616  Remarks:
2617  None.
2618 */
2619 
2620 uint32_t
2622  DRV_HANDLE handle ) ;
2623 // *****************************************************************************
2624 // *****************************************************************************
2625 // Section: TMR Driver Control and Information Functions
2626 // *****************************************************************************
2627 // *****************************************************************************
2628 // *****************************************************************************
2629 /* Function:
2630  bool DRV_TMR_ClockSet
2631  (
2632  DRV_HANDLE handle,
2633  DRV_TMR_CLK_SOURCES clockSource,
2634  TMR_PRESCALE preScale
2635  )
2636  Summary:
2637  Sets the timers clock by selecting the source and prescaler.
2638  <p><b>Implementation:</b> Dynamic</p>
2639  Description:
2640  This function sets the timer clock by selecting the source and prescaler.
2641  The clock sources are device specific, refer device datasheet for supported
2642  clock sources. If unsupported clock source is passed then the behaviour of
2643  this function is unpredictable.
2644  Precondition:
2645  The DRV_TMR_Initialize function must have been called. Must have selected
2646  32-Bit timer mode if mode selection is applicable.
2647  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2648  Parameters:
2649  handle - A valid open-instance handle, returned from the driver's
2650  open routine
2651  clockSource - Clock source of the timer
2652  preScale - Timer's Prescaler divisor
2653  Returns:
2654  - true - if the operation is successful
2655  - false - either the handle is invalid or the clockSource
2656  and/or prescaler are not supported
2657  Example:
2658  <code>
2659  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2660  DRV_TMR_ClockSet ( tmrHandle, DRV_TMR_CLKSOURCE_INTERNAL, TMR_PRESCALE_VALUE_256 );
2661  </code>
2662  Remarks:
2663  None.
2664 */
2665 
2666 bool
2668  DRV_HANDLE handle ,
2669  DRV_TMR_CLK_SOURCES clockSource ,
2670  TMR_PRESCALE preScale ) ;
2671 // *****************************************************************************
2672 /* Function:
2673  TMR_PRESCALE DRV_TMR_PrescalerGet ( DRV_HANDLE handle )
2674  Summary:
2675  This function gets the currently selected prescaler.
2676  <p><b>Implementation:</b> Dynamic</p>
2677  Description:
2678  This function gets the currently selected prescaler.
2679  Precondition:
2680  The DRV_TMR_Initialize function must have been called.
2681  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2682  Parameters:
2683  handle - A valid open-instance handle, returned from the driver's
2684  open routine
2685  Returns:
2686  Timer prescaler.
2687  Example:
2688  <code>
2689  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2690  TMR_PRESCALE preScale;
2691  preScale = DRV_TMR_PrescalerGet ( tmrHandle );
2692  </code>
2693  Remarks:
2694  None.
2695 */
2696 
2697 TMR_PRESCALE
2699  DRV_HANDLE handle ) ;
2700 // *****************************************************************************
2701 /* Function:
2702  DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
2703  Summary:
2704  This function gets the currently selected operation mode.
2705  <p><b>Implementation:</b> Dynamic</p>
2706  Description:
2707  This function gets the currently selected 16/32 bit operation mode.
2708  Precondition:
2709  The DRV_TMR_Initialize function must have been called.
2710  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2711  Parameters:
2712  handle - A valid open-instance handle, returned from the driver's
2713  open routine
2714  Returns:
2715  A DRV_TMR_OPERATION_MODE value showing how the timer is currently
2716  configured. DRV_TMR_OPERATION_MODE_NONE is returned for an invalid client
2717  handle.
2718  Example:
2719  <code>
2720  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2721  DRV_TMR_OPERATION_MODE operMode;
2722  operMode = DRV_TMR_OperationModeGet ( tmrHandle );
2723  </code>
2724  Remarks:
2725  None.
2726 */
2727 
2730  DRV_HANDLE handle ) ;
2731 // *****************************************************************************
2732 /* Function:
2733  bool DRV_TMR_GateModeSet ( DRV_HANDLE handle )
2734  Summary:
2735  Enables the Gate mode.
2736  <p><b>Implementation:</b> Dynamic</p>
2737  Description:
2738  This function enables the Gated mode of Timer. User can measure the duration
2739  of an external signal in this mode. Once the Gate mode is enabled, Timer
2740  will start on the raising edge of the external signal. It will keep counting
2741  until the next falling edge.
2742  Precondition:
2743  The DRV_TMR_Initialize function must have been called.
2744  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2745  Parameters:
2746  handle - A valid open-instance handle, returned from the driver's
2747  open routine
2748  Returns:
2749  - true - if the operation is successful
2750  - false - either the handle is invalid or the gate mode
2751  is not supported
2752  Example:
2753  <code>
2754  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2755  DRV_TMR_GateModeSet ( tmrHandle );
2756  </code>
2757  Remarks:
2758  None.
2759 */
2760 
2761 bool
2763  DRV_HANDLE handle ) ;
2764 // *****************************************************************************
2765 /* Function:
2766  bool DRV_TMR_GateModeClear ( DRV_HANDLE handle )
2767  Summary:
2768  Enables the Gate mode.
2769  <p><b>Implementation:</b> Dynamic</p>
2770  Description:
2771  This function enables the Gated mode of Timer. User can measure the duration
2772  of an external signal in this mode. Once the Gate mode is enabled, Timer
2773  will start on the raising edge of the external signal. It will keep counting
2774  until the next falling edge.
2775  Precondition:
2776  The DRV_TMR_Initialize function must have been called.
2777  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2778  Parameters:
2779  handle - A valid open-instance handle, returned from the driver's
2780  open routine
2781  Returns:
2782  - true - if the operation is successful
2783  - false - either the handle is invalid or the gate mode
2784  is not supported
2785  Example:
2786  <code>
2787  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2788  DRV_TMR_GateModeClear ( tmrHandle );
2789  </code>
2790  Remarks:
2791  None.
2792 */
2793 
2794 bool
2796  DRV_HANDLE handle ) ;
2797 // *****************************************************************************
2798 /* Function:
2799  uint32_t DRV_TMR_CounterFrequencyGet ( DRV_HANDLE handle )
2800  Summary:
2801  Provides the Timer input frequency.
2802  <p><b>Implementation:</b> Dynamic</p>
2803  Description:
2804  This function provides the Timer input frequency. Input frequency is the
2805  clock to the Timer register and it is considering the prescaler divisor.
2806  Precondition:
2807  The DRV_TMR_Initialize function must have been called.
2808  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2809  Parameters:
2810  handle - A valid open-instance handle, returned from the driver's
2811  open routine
2812  Returns:
2813  32-bit value corresponding to the running frequency.
2814  If Timer clock source is external, then this function returns 0.
2815  Example:
2816  <code>
2817  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2818  uint32_t clkFreqHz;
2819  clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2820  </code>
2821  Remarks:
2822  On most processors, the Timer's base frequency is the same as the peripheral
2823  bus clock.
2824 */
2825 
2826 uint32_t
2828  DRV_HANDLE handle ) ;
2829 // *****************************************************************************
2830 /* Function:
2831  DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet
2832  (
2833  DRV_HANDLE handle,
2834  DRV_TMR_DIVIDER_RANGE* pDivRange
2835  )
2836  Summary:
2837  Returns the Timer divider values.
2838  <p><b>Implementation:</b> Dynamic</p>
2839  Description:
2840  This function provides the Timer operating mode and divider range.
2841  Precondition:
2842  The DRV_TMR_Initialize function must have been called.
2843  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2844  Parameters:
2845  handle - A valid open-instance handle, returned from the driver's
2846  open routine
2847  pDivRange - Address to store the timer divider range.
2848  Returns:
2849  - A DRV_TMR_OPERATION_MODE value showing how the timer is currently configured.
2850  The pDivRange is updated with the supported range values.
2851  - DRV_TMR_OPERATION_MODE_NONE for invalid client handle
2852  Example:
2853  <code>
2854  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2855  DRV_TMR_OPERATION_MODE timerMode;
2856  DRV_TMR_DIVIDER_RANGE timerRange;
2857  DRV_TMR_DividerRangeGet(handle, &timerRange);
2858  uint32_t clkFreqHz = DRV_TMR_CounterFrequencyGet ( tmrHandle );
2859  uint32_t maxFreqHz = clkFreqHz / timerRange.dividerMin;
2860  uint32_t minFreqHz = clkFreqHz / timerRange.dividerMax;
2861  </code>
2862  Remarks:
2863  None.
2864 */
2865 
2868  DRV_HANDLE handle ,
2869  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
2870 // *****************************************************************************
2871 // *****************************************************************************
2872 // Section: File includes for the APIs which are required for backward
2873 // compatibility.
2874 // *****************************************************************************
2875 // *****************************************************************************
2876 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h */
2877 /*******************************************************************************
2878  Timer Device Driver Interface Definition
2879  Company:
2880  Microchip Technology Inc.
2881  File Name:
2882  drv_tmr_compatibility.h
2883  Summary:
2884  Timer device driver interface header file.
2885  Description:
2886  This header file contains macro definition for APIs which will be deprecated
2887  later. This header file is included in drv_tmr.h.
2888 *******************************************************************************/
2889 //DOM-IGNORE-BEGIN
2890 /*******************************************************************************
2891 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
2892 Microchip licenses to you the right to use, modify, copy and distribute
2893 Software only when embedded on a Microchip microcontroller or digital signal
2894 controller that is integrated into your product or third party product
2895 (pursuant to the sublicense terms in the accompanying license agreement).
2896 You should refer to the license agreement accompanying this Software for
2897 additional information regarding your rights and obligations.
2898 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
2899 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
2900 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
2901 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
2902 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
2903 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
2904 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
2905 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
2906 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
2907 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
2908 *******************************************************************************/
2909 //DOM-IGNORE-END
2910 #ifndef _DRV_TMR_DEPRECATED_H
2911 #define _DRV_TMR_DEPRECATED_H
2912 // *****************************************************************************
2913 // *****************************************************************************
2914 // Section: File includes
2915 // *****************************************************************************
2916 // *****************************************************************************
2917 // *****************************************************************************
2918 /* Function:
2919  void DRV_TMR_Tasks_ISR ( SYS_MODULE_OBJ object )
2920  Summary:
2921  Maintains the driver's state machine, processes the events and implements
2922  its ISR.
2923  <p><b>Implementation:</b> Dynamic</p>
2924  Description:
2925  This function is used to maintain the driver's internal state machine and
2926  processes the timer events in interrupt-driven implementations
2927  (DRV_TMR_INTERRUPT_MODE == true).
2928  Precondition:
2929  The DRV_TMR_Initialize function must have been called for the specified Timer
2930  driver instance.
2931  Parameters:
2932  object - Object handle for the specified driver instance (returned from
2933  DRV_TMR_Initialize)
2934  Returns:
2935  None
2936  Example:
2937  <code>
2938  void __ISR(_TIMER_2_VECTOR, ipl4) _InterruptHandler_TMR2(void)
2939  {
2940  DRV_TMR_Tasks_ISR(appDrvObjects.drvTmrObject);
2941  }
2942  </code>
2943  Remarks:
2944  This function is normally not called directly by an application.
2945  It is called by the timer driver raw ISR.
2946  This function will execute in an ISR context and will never block or access any
2947  resources that may cause it to block.
2948 
2949  This function will be deprecated later, so avoid using it as much as possible.
2950  Use generic function "DRV_TMR_Tasks" instead of this.
2951 */
2952 #define DRV_TMR_Tasks_ISR( object ) DRV_TMR_Tasks ( object )
2953 // *****************************************************************************
2954 /* Function:
2955  void DRV_TMR_CounterValue16BitSet
2956  (
2957  DRV_HANDLE handle,
2958  uint16_t counterPeriod
2959  )
2960  Summary:
2961  Updates the 16-bit Timer's counter register.
2962  <p><b>Implementation:</b> Dynamic</p>
2963  Description:
2964  This function updates the 16-bit Timer's value in the counter register. This
2965  is valid only if the 16-bit mode of the timer is selected('mode' in the INIT
2966  structure is set to DRV_TMR_OPERATION_MODE_16_BIT). Otherwise use
2967  DRV_TMR_CounterValue32BitSet function.
2968  Precondition:
2969  The DRV_TMR_Initialize function must have been called. Must have selected
2970  16-Bit timer mode if mode selection is applicable.
2971  DRV_TMR_Open must have been called to obtain a valid opened device handle.
2972  Parameters:
2973  handle - A valid open-instance handle, returned from the driver's
2974  open routine
2975  counterPeriod - 16-bit counter period value
2976  Returns:
2977  None.
2978  Example:
2979  <code>
2980  //Example to use timer for precision time measurement
2981  //without configuring an alarm (interrupt based)
2982  char appState = 0;
2983  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
2984 
2985  switch ( appState )
2986  {
2987  case 0:
2988  //Calculate and set the counter period
2989  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
2990 
2991  //counter starts
2992  DRV_TMR_Start ( tmrHandle );
2993 
2994  //Trigger an application operation
2995  app_trigger_operation();
2996 
2997  //Check for time-out in the next state
2998  appState++;
2999  case 1:
3000  //Overflows and stops at 0 if no alarm is set
3001  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3002  {
3003  //Time-out
3004  return false;
3005  }
3006  else if ( app_operation_isComplete( ) )
3007  {
3008  //Operation is complete before time-out
3009  return true;
3010  }
3011  </code>
3012  Remarks:
3013  This function will be deprecated later, so avoid using it as much as possible.
3014  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3015 */
3016 #define DRV_TMR_CounterValue16BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3017 // *****************************************************************************
3018 /* Function:
3019  void DRV_TMR_CounterValue32BitSet
3020  (
3021  DRV_HANDLE handle,
3022  uint32_t counterPeriod
3023  )
3024  Summary:
3025  Updates the 32-bit Timer's counter register.
3026  <p><b>Implementation:</b> Dynamic</p>
3027  Description:
3028  This function updates the 32-bit Timer's value in the counter register. This
3029  is valid only if the 32-bit mode of the timer is selected Otherwise use
3030  DRV_TMR_CounterValue16BitSet function.
3031  Precondition:
3032  The DRV_TMR_Initialize function must have been called. Must have selected
3033  32-Bit timer mode.
3034  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3035  Parameters:
3036  handle - A valid open-instance handle, returned from the driver's
3037  open routine
3038  counterPeriod - 32-bit counter period value
3039  Returns:
3040  None.
3041  Example:
3042  <code>
3043  //Example to use timer for precision time measurement
3044  //without configuring an alarm (interrupt based)
3045  char appState = 0;
3046  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3047 
3048  switch ( appState )
3049  {
3050  case 0:
3051  //Calculate and set the counter period
3052  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0xFF343100 ) );
3053 
3054  //counter starts
3055  DRV_TMR_Start ( tmrHandle );
3056 
3057  //Trigger an application operation against which we want to use the time-out
3058  app_trigger_operation();
3059 
3060  //Check for time-out in the next state
3061  appState++;
3062  case 1:
3063  //Overflows and stops at 0 if no alarm is set
3064  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3065  {
3066  //Time-out
3067  return false;
3068  }
3069  else if ( app_operation_isComplete( ) )
3070  {
3071  //Operation is complete before time-out
3072  return true;
3073  }
3074  </code>
3075  Remarks:
3076  In most of the devices only even numbered instances of timer supports
3077  32-bit mode.
3078  This function will be deprecated later, so avoid using it as much as possible.
3079  Use generic function "DRV_TMR_CounterValueSet" instead of this.
3080 */
3081 #define DRV_TMR_CounterValue32BitSet( handle , counterPeriod ) DRV_TMR_CounterValueSet ( handle , counterPeriod )
3082 // *****************************************************************************
3083 /* Function:
3084  uint16_t DRV_TMR_CounterValue16BitGet ( DRV_HANDLE handle )
3085  Summary:
3086  Reads the 16-bit Timer's counter register.
3087  <p><b>Implementation:</b> Dynamic</p>
3088  Description:
3089  This function returns the 16-bit Timer's value in the counter register. This
3090  is valid only if the 16-bit mode of the timer is selected.
3091  Otherwise use DRV_TMR_CounterValue32BitGet function.
3092  Precondition:
3093  The DRV_TMR_Initialize function must have been called. Must have selected
3094  16-Bit timer mode if mode selection is applicable.
3095  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3096  Parameters:
3097  handle - A valid open-instance handle, returned from the driver's
3098  open routine
3099 
3100  Returns:
3101  Timer period in 16-bit mode.
3102  Example:
3103  <code>
3104  //Example to use timer for precision time measurement
3105  //without configuring an alarm (interrupt based)
3106  char appState = 0;
3107  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3108 
3109  switch ( appState )
3110  {
3111  case 0:
3112  //Calculate and set the counter period
3113  DRV_TMR_CounterValue16BitSet ( tmrHandle, ( 0xFFFF - 0x1000 ) );
3114 
3115  //counter starts
3116  DRV_TMR_Start ( tmrHandle );
3117 
3118  //Trigger an application operation
3119  app_trigger_operation();
3120 
3121  //Check for time-out in the next state
3122  appState++;
3123  case 1:
3124  //Overflows and stops at 0 if no alarm is set
3125  if ( DRV_TMR_CounterValue16BitGet ( tmrHandle ) == 0 )
3126  {
3127  //Time-out
3128  return false;
3129  }
3130  else if ( app_operation_isComplete( ) )
3131  {
3132  //Operation is complete before time-out
3133  return true;
3134  }
3135  </code>
3136  Remarks:
3137  This function will be deprecated later, so avoid using it as much as possible.
3138  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3139 */
3140 #define DRV_TMR_CounterValue16BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3141 // *****************************************************************************
3142 /* Function:
3143  uint32_t DRV_TMR_CounterValue32BitGet ( DRV_HANDLE handle )
3144  Summary:
3145  Reads the 32-bit Timer's counter register.
3146  <p><b>Implementation:</b> Dynamic</p>
3147  Description:
3148  This function returns the 32-bit Timer's value in the counter register. This
3149  is valid only if the 32-bit mode of the timer is selected Otherwise use
3150  DRV_TMR_CounterValue16BitGet function.
3151  Precondition:
3152  The DRV_TMR_Initialize function must have been called. Must have selected
3153  32-Bit timer mode.
3154  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3155  Parameters:
3156  handle - A valid open-instance handle, returned from the driver's
3157  open routine
3158 
3159  Returns:
3160  32-Bit Counter value.
3161  Example:
3162  <code>
3163  //Example to use timer for precision time measurement
3164  //without configuring an alarm (interrupt based)
3165  char appState = 0;
3166  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3167 
3168  switch ( appState )
3169  {
3170  case 0:
3171  //Calculate and set the counter period
3172  DRV_TMR_CounterValue32BitSet ( tmrHandle, ( 0xFFFFFFFF - 0x23321000 ) );
3173 
3174  //counter starts
3175  DRV_TMR_Start ( tmrHandle );
3176 
3177  //Trigger an application operation
3178  app_trigger_operation();
3179 
3180  //Check for time-out in the next state
3181  appState++;
3182  case 1:
3183  //Overflows and stops at 0 if no alarm is set
3184  if ( DRV_TMR_CounterValue32BitGet ( tmrHandle ) == 0 )
3185  {
3186  //Time-out
3187  return false;
3188  }
3189  else if ( app_operation_isComplete( ) )
3190  {
3191  //Operation is complete before time-out
3192  return true;
3193  }
3194  </code>
3195  Remarks:
3196  In most of the devices only even numbered instances of timer supports
3197  32-bit mode.
3198  This function will be deprecated later, so avoid using it as much as possible.
3199  Use generic function "DRV_TMR_CounterValueGet" instead of this.
3200 */
3201 #define DRV_TMR_CounterValue32BitGet( handle ) DRV_TMR_CounterValueGet ( handle )
3202 // *****************************************************************************
3203 /* Function:
3204  void DRV_TMR_Alarm16BitRegister
3205  (
3206  DRV_HANDLE handle,
3207  uint16_t period,
3208  bool isPeriodic,
3209  uintptr_t context,
3210  DRV_TMR_CALLBACK callBack
3211  )
3212  Summary:
3213  Sets up an alarm.
3214  <p><b>Implementation:</b> Dynamic</p>
3215  Description:
3216  This function sets up an alarm, allowing the client to receive a callback
3217  from the driver when the counter period elapses. Alarms can be one-shot or
3218  periodic. This API is valid only if the 16-bit mode of the timer is
3219  selected. Otherwise use DRV_TMR_Alarm32BitRegister function.
3220  Precondition:
3221  The DRV_TMR_Initialize function must have been called. Must have selected
3222  16-Bit timer mode if mode selection is applicable.
3223  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3224  Parameters:
3225  handle - A valid handle, returned from DRV_TMR_Open
3226  period - 16-bit period which will be loaded into the Timer hardware register.
3227 
3228  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3229 
3230  context - A reference, call back function will be called with the same
3231  reference.
3232 
3233  callBack - A call back function which will be called on period elapse.
3234 
3235  Returns:
3236  None
3237  Example:
3238  <code>
3239  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3240 
3241  void setupTask ()
3242  {
3243  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3244 
3245  // Calculate the count to be passed on from the clock input
3246  //Periodically toggle LED
3247  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF40, true, 0,
3248  ToggleLedCallBack );
3249  }
3250 
3251  void ToggleLedCallBack ( uintptr_t context )
3252  {
3253  //Toggle
3254  }
3255  </code>
3256  Remarks:
3257  This function will be deprecated later, so avoid using it as much as possible.
3258  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3259 */
3260 #define DRV_TMR_Alarm16BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3261 // *****************************************************************************
3262 /* Function:
3263  void DRV_TMR_Alarm32BitRegister
3264  (
3265  DRV_HANDLE handle,
3266  uint32_t period,
3267  bool isPeriodic,
3268  uintptr_t context,
3269  DRV_TMR_CALLBACK callBack
3270  )
3271  Summary:
3272  Sets up an alarm.
3273  <p><b>Implementation:</b> Dynamic</p>
3274  Description:
3275  This function sets up an alarm, allowing the client to receive a callback
3276  from the driver when the counter period elapses. Alarms can be one-shot or
3277  periodic. This API is valid only if the 32-bit mode of the timer is
3278  selected Otherwise use DRV_TMR_Alarm16BitRegister function.
3279  Precondition:
3280  The DRV_TMR_Initialize function must have been called. Must have selected
3281  32-Bit timer mode.
3282  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3283  Parameters:
3284  handle - A valid handle, returned from DRV_TMR_Open
3285  period - 32-bit period which will be loaded into the Timer hardware register.
3286 
3287  isPeriodic - Flag indicating whether the alarm should be one-shot or periodic.
3288 
3289  context - A reference, call back function will be called with the same
3290  reference.
3291 
3292  callBack - A call back function which will be called on period elapse.
3293 
3294  Returns:
3295  None
3296  Example:
3297  <code>
3298  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3299 
3300  void setupTask ()
3301  {
3302  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3303 
3304  // Calculate the count to be passed on from the clock input
3305  //Periodically toggle LED
3306  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFFFFFF00, true, 0,
3307  ToggleLedCallBack );
3308  }
3309 
3310  void ToggleLedCallBack ( uintptr_t context )
3311  {
3312  //Toggle
3313  }
3314  </code>
3315  Remarks:
3316  In most of the devices only even numbered instances of timer supports
3317  32-bit mode.
3318  This function will be deprecated later, so avoid using it as much as possible.
3319  Use generic function "DRV_TMR_AlarmRegister" instead of this.
3320 */
3321 #define DRV_TMR_Alarm32BitRegister( handle , period , isPeriodic , context , callBack ) DRV_TMR_AlarmRegister ( handle , period , isPeriodic , context , callBack )
3322 // *****************************************************************************
3323 /* Function:
3324  void DRV_TMR_AlarmPeriod16BitSet ( DRV_HANDLE handle, uint16_t value )
3325  Summary:
3326  Updates the 16-bit Timer's period.
3327  <p><b>Implementation:</b> Dynamic</p>
3328  Description:
3329  This function updates the 16-bit Timer's period. This API is valid only if
3330  the 16-bit mode of the timer is selected
3331  Otherwise use DRV_TMR_AlarmPeriod32BitSet function.
3332  Precondition:
3333  The DRV_TMR_Initialize function must have been called. Must have selected
3334  16-Bit timer mode if mode selection is applicable.
3335  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3336  Parameters:
3337  handle - A valid open-instance handle, returned from the driver's
3338  open routine
3339  value - 16-bit Period value
3340  Returns:
3341  None.
3342  Example:
3343  <code>
3344  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3345  DRV_TMR_AlarmPeriod16BitSet ( handle, 0x1000 );
3346  </code>
3347  Remarks:
3348  This function will be deprecated later, so avoid using it as much as possible.
3349  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3350 */
3351 #define DRV_TMR_AlarmPeriod16BitSet( handle , value ) DRV_TMR_AlarmPeriodSet ( handle , value )
3352 // *****************************************************************************
3353 /* Function:
3354  void DRV_TMR_AlarmPeriod32BitSet ( DRV_HANDLE handle, uint32_t period )
3355  Summary:
3356  Updates the 32-bit Timer's period.
3357  <p><b>Implementation:</b> Dynamic</p>
3358  Description:
3359  This function updates the 32-bit Timer's period. This API is valid only if
3360  the 32-bit mode of the timer is selected
3361  Otherwise use DRV_TMR_AlarmPeriod16BitSet function.
3362  Precondition:
3363  The DRV_TMR_Initialize unction must have been called. Must have selected
3364  32-Bit timer mode.
3365  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3366  Parameters:
3367  handle - A valid open-instance handle, returned from the driver's
3368  open routine
3369  period - 32-bit Period value
3370  Returns:
3371  None.
3372  Example:
3373  <code>
3374  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3375  DRV_TMR_AlarmPeriod32BitSet ( handle, 0xFFFFFF00 );
3376  </code>
3377  Remarks:
3378  In most of the devices only even numbered instances of timer supports
3379  32-bit mode.
3380  This function will be deprecated later, so avoid using it as much as possible.
3381  Use generic function "DRV_TMR_AlarmPeriodSet" instead of this.
3382 */
3383 #define DRV_TMR_AlarmPeriod32BitSet( handle , period ) DRV_TMR_AlarmPeriodSet ( handle , period )
3384 // *****************************************************************************
3385 /* Function:
3386  uint16_t DRV_TMR_AlarmPeriod16BitGet ( DRV_HANDLE handle )
3387  Summary:
3388  Provides the 16-bit Timer's period.
3389  <p><b>Implementation:</b> Dynamic</p>
3390  Description:
3391  This function gets the 16-bit Timer's period. This API is valid only if
3392  the 16-bit mode of the timer is selected.
3393  Otherwise use DRV_TMR_AlarmPeriod32BitGet function.
3394  Precondition:
3395  The DRV_TMR_Initialize function must have been called. Must have selected
3396  16-Bit timer mode if mode selection is applicable.
3397  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3398  Parameters:
3399  handle - A valid open-instance handle, returned from the driver's
3400  open routine
3401  Returns:
3402  16-bit timer period value
3403  Example:
3404  <code>
3405  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3406  uint16_t period;
3407 
3408  period = DRV_TMR_AlarmPeriod16BitGet ( tmrHandle );
3409  </code>
3410  Remarks:
3411  This function will be deprecated later, so avoid using it as much as possible.
3412  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3413 */
3414 #define DRV_TMR_AlarmPeriod16BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3415 // *****************************************************************************
3416 /* Function:
3417  uint32_t DRV_TMR_AlarmPeriod32BitGet ( DRV_HANDLE handle )
3418  Summary:
3419  Provides the 32-bit Timer's period.
3420  <p><b>Implementation:</b> Dynamic</p>
3421  Description:
3422  This function gets the 32-bit Timer's period. This API is valid only if
3423  the 32-bit mode of the timer is selected
3424  Otherwise use DRV_TMR_AlarmPeriod16BitGet function.
3425  Precondition:
3426  The DRV_TMR_Initialize function must have been called. Must have selected
3427  32-Bit timer mode.
3428  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3429  Parameters:
3430  handle - A valid open-instance handle, returned from the driver's
3431  open routine
3432  Returns:
3433  32-bit Timer period value.
3434  Example:
3435  <code>
3436  DRV_HANDLE handle; // Returned from DRV_TMR_Open
3437  uint32_t period;
3438  period = DRV_TMR_AlarmPeriod32BitGet ( handle );
3439  </code>
3440  Remarks:
3441  In most of the devices only even numbered instances of timer supports
3442  32-bit mode.
3443  This function will be deprecated later, so avoid using it as much as possible.
3444  Use generic function "DRV_TMR_AlarmPeriodGet" instead of this.
3445 */
3446 #define DRV_TMR_AlarmPeriod32BitGet( handle ) DRV_TMR_AlarmPeriodGet ( handle )
3447 // *****************************************************************************
3448 /* Function:
3449  void DRV_TMR_Alarm16BitDeregister ( DRV_HANDLE handle )
3450  Summary:
3451  Removes a previously set alarm.
3452  <p><b>Implementation:</b> Dynamic</p>
3453  Description:
3454  This function removes a previously set alarm. This API is valid only if
3455  the 16-bit mode of the timer is selected
3456  Otherwise use DRV_TMR_Alarm32BitDeregister function.
3457  Precondition:
3458  The DRV_TMR_Initialize function must have been called. Must have selected
3459  16-Bit timer mode if mode selection is applicable.
3460  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3461 
3462  DRV_TMR_Alarm16BitRegister function must have been called before.
3463  Parameters:
3464  handle - A valid open-instance handle, returned from the driver's
3465  open routine
3466  Returns:
3467  None.
3468  Example:
3469  <code>
3470  //Example of a key debounce check
3471 
3472  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3473  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3474  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_16_BIT
3475 
3476  void keyPressDetect ()
3477  {
3478  // Calculate the count to be passed on from the clock input
3479  //Periodically toggle LED
3480  DRV_TMR_Alarm16BitRegister ( tmrHandle, 0xFF00, true,
3481  DebounceCheck );
3482  }
3483 
3484  void DebounceCheck ( uintptr_t context )
3485  {
3486  readKey = AppReadKey();
3487 
3488  if ( readKey != lastReadKey )
3489  {
3490  lastReadKey = readKey;
3491  keyCount = 0;
3492  }
3493  else
3494  {
3495  if ( keyCount > 20 )
3496  {
3497  globalKeyState = readKey;
3498  DRV_TMR_Alarm16BitDeregister ( tmrHandle );
3499  }
3500  keyCount++;
3501  }
3502  }
3503  </code>
3504  Remarks:
3505  This function will be deprecated later, so avoid using it as much as possible.
3506  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3507 */
3508 #define DRV_TMR_Alarm16BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3509 // *****************************************************************************
3510 /* Function:
3511  void DRV_TMR_Alarm32BitDeregister ( DRV_HANDLE handle )
3512  Summary:
3513  Removes a previously set alarm.
3514  <p><b>Implementation:</b> Dynamic</p>
3515  Description:
3516  This function removes a previously set alarm. This API is valid only if
3517  the 32-bit mode of the timer is selected
3518  Otherwise use DRV_TMR_Alarm16BitDeregister function.
3519  Precondition:
3520  The DRV_TMR_Initialize function must have been called. Must have selected
3521  32-Bit timer mode if mode selection is applicable.
3522  DRV_TMR_Open must have been called to obtain a valid opened device handle.
3523 
3524  DRV_TMR_Alarm32BitRegister function must have been called before.
3525  Parameters:
3526  handle - A valid open-instance handle, returned from the driver's
3527  open routine
3528  Returns:
3529  None.
3530  Example:
3531  <code>
3532  //Example of a key debounce check
3533 
3534  static unsigned int lastReadKey, readKey, keyCount, globalKeyState;
3535  DRV_HANDLE tmrHandle; // Returned from DRV_TMR_Open
3536  //Do the initialization with 'mode' set to DRV_TMR_OPERATION_MODE_32_BIT
3537 
3538  void keyPressDetect ( void )
3539  {
3540  // Calculate the count to be passed on from the clock input
3541  //Periodically check the key status
3542  DRV_TMR_Alarm32BitRegister ( tmrHandle, 0xFF0FFD20, true, 0,
3543  DebounceCheck );
3544  }
3545 
3546  void DebounceCheck ( uintptr_t context )
3547  {
3548  readKey = AppReadKey();
3549 
3550  if ( readKey != lastReadKey )
3551  {
3552  lastReadKey = readKey;
3553  keyCount = 0;
3554  }
3555  else
3556  {
3557  if ( keyCount > 20 )
3558  {
3559  //Key is stable now
3560  globalKeyState = readKey;
3561  DRV_TMR_Alarm32BitDeregister ( tmrHandle );
3562  }
3563  keyCount++;
3564  }
3565  }
3566  </code>
3567  Remarks:
3568  In most of the devices only even numbered instances of timer supports
3569  32-bit mode.
3570  This function will be deprecated later, so avoid using it as much as possible.
3571  Use generic function "DRV_TMR_AlarmDeregister" instead of this.
3572 */
3573 #define DRV_TMR_Alarm32BitDeregister( handle ) DRV_TMR_AlarmDeregister ( handle )
3574  // #ifndef _DRV_TMR_DEPRECATED_H
3575 /*******************************************************************************
3576  End of File
3577 */
3578 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr_compatibility.h*/
3579 /* CLOSE_FILE Include File */
3580 
3581 //DOM-IGNORE-BEGIN
3582 //DOM-IGNORE-END
3583  // #ifndef _DRV_TMR_H
3584 /*******************************************************************************
3585  End of File
3586 */
3587 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\tmr\drv_tmr.h*/
3588 /* CLOSE_FILE Include File */
3589 
3590 #include "peripheral/tmr/plib_tmr.h"
3591 #include "peripheral/int/plib_int.h"
3592 // maximum divider value for 32 bit operation mode
3593 #define DRV_TIMER_DIVIDER_MAX_32BIT 0xffffffff
3594 // minimum divider value for 32 bit operation mode
3595 #define DRV_TIMER_DIVIDER_MIN_32BIT 0x2
3596 // maximum divider value for 16 bit operation mode
3597 #define DRV_TIMER_DIVIDER_MAX_16BIT 0x10000
3598 // minimum divider value for 16 bit operation mode
3599 #define DRV_TIMER_DIVIDER_MIN_16BIT 0x2
3600 // *****************************************************************************
3601 // *****************************************************************************
3602 // Section: Interface Headers for Instance 0 for the static driver
3603 // *****************************************************************************
3604 // *****************************************************************************
3605 
3606 void
3607  DRV_TMR0_Initialize ( void ) ;
3608 
3609 bool
3610  DRV_TMR0_Start ( void ) ;
3611 
3612 void
3613  DRV_TMR0_Stop ( void ) ;
3614 
3615 static inline void
3617  {
3618  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 0))); /* 37 */
3619  DRV_TMR0_Stop () ;
3620  ((int)(bitmapstruct.element0 |= (1 << 1))); /* 30 */
3621  wl_sps_50zqendz ( 2 ) ; /* 30 */
3622  }
3623 
3624 static inline SYS_STATUS
3626 {
3627  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 2))); /* 37 */
3628  /* Return the status as ready always */
3629  ((int)(bitmapstruct.element0 |= (1 << 3))); /* 30 */
3630  wl_sps_50zqendz ( 4 ) ; /* 30 */
3631  return
3632  SYS_STATUS_READY ;
3633 }
3634 
3635 static inline void
3636  DRV_TMR0_Open ( void )
3637  {
3638  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 4))); /* 37 */
3639  ((int)(bitmapstruct.element0 |= (1 << 5))); /* 30 */
3640  wl_sps_50zqendz ( 6 ) ; /* 30 */
3641  }
3642 
3644  DRV_TMR0_ClientStatus ( void ) ;
3645 
3646 static inline DRV_TMR_OPERATION_MODE
3648 {
3649  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 6))); /* 37 */
3650  ((int)(bitmapstruct.element0 |= (1 << 7))); /* 30 */
3651  wl_sps_50zqendz ( 8 ) ; /* 30 */
3652  return
3654 }
3655 
3656 static inline void
3658  {
3659  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 8))); /* 37 */
3660  DRV_TMR0_Stop () ;
3661  ((int)(bitmapstruct.element0 |= (1 << 9))); /* 30 */
3662  wl_sps_50zqendz ( 10 ) ; /* 30 */
3663  }
3664 
3665 bool
3667  DRV_TMR_CLK_SOURCES clockSource ,
3668  TMR_PRESCALE prescale ) ;
3669 
3670 void
3672  uint32_t value ) ;
3673 
3674 uint32_t
3675  DRV_TMR0_CounterValueGet ( void ) ;
3676 
3677 void
3678  DRV_TMR0_CounterClear ( void ) ;
3679 
3680 TMR_PRESCALE
3681  DRV_TMR0_PrescalerGet ( void ) ;
3682 
3683 void
3685  uint32_t value ) ;
3686 
3687 uint32_t
3688  DRV_TMR0_PeriodValueGet ( void ) ;
3689 
3690 void
3691  DRV_TMR0_StopInIdleDisable ( void ) ;
3692 
3693 void
3694  DRV_TMR0_StopInIdleEnable ( void ) ;
3695 
3696 static inline void
3698  {
3699  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 10))); /* 37 */
3700  ((int)(bitmapstruct.element0 |= (1 << 11))); /* 30 */
3701  wl_sps_50zqendz ( 12 ) ; /* 30 */
3702  }
3703 
3704 uint32_t
3705  DRV_TMR0_CounterFrequencyGet ( void ) ;
3706 
3709  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3710 // *****************************************************************************
3711 // *****************************************************************************
3712 // Section: Interface Headers for Instance 1 for the static driver
3713 // *****************************************************************************
3714 // *****************************************************************************
3715 
3716 void
3717  DRV_TMR1_Initialize ( void ) ;
3718 
3719 bool
3720  DRV_TMR1_Start ( void ) ;
3721 
3722 void
3723  DRV_TMR1_Stop ( void ) ;
3724 
3725 static inline void
3727  {
3728  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 12))); /* 37 */
3729  DRV_TMR1_Stop () ;
3730  ((int)(bitmapstruct.element0 |= (1 << 13))); /* 30 */
3731  wl_sps_50zqendz ( 14 ) ; /* 30 */
3732  }
3733 
3734 static inline SYS_STATUS
3736 {
3737  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 14))); /* 37 */
3738  /* Return the status as ready always */
3739  ((int)(bitmapstruct.element0 |= (1 << 15))); /* 30 */
3740  wl_sps_50zqendz ( 16 ) ; /* 30 */
3741  return
3742  SYS_STATUS_READY ;
3743 }
3744 
3745 static inline void
3746  DRV_TMR1_Open ( void )
3747  {
3748  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 16))); /* 37 */
3749  ((int)(bitmapstruct.element0 |= (1 << 17))); /* 30 */
3750  wl_sps_50zqendz ( 18 ) ; /* 30 */
3751  }
3752 
3754  DRV_TMR1_ClientStatus ( void ) ;
3755 
3756 static inline DRV_TMR_OPERATION_MODE
3758 {
3759  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 18))); /* 37 */
3760  ((int)(bitmapstruct.element0 |= (1 << 19))); /* 30 */
3761  wl_sps_50zqendz ( 20 ) ; /* 30 */
3762  return
3764 }
3765 
3766 static inline void
3768  {
3769  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 20))); /* 37 */
3770  DRV_TMR1_Stop () ;
3771  ((int)(bitmapstruct.element0 |= (1 << 21))); /* 30 */
3772  wl_sps_50zqendz ( 22 ) ; /* 30 */
3773  }
3774 
3775 bool
3777  DRV_TMR_CLK_SOURCES clockSource ,
3778  TMR_PRESCALE prescale ) ;
3779 
3780 void
3782  uint32_t value ) ;
3783 
3784 uint32_t
3785  DRV_TMR1_CounterValueGet ( void ) ;
3786 
3787 void
3788  DRV_TMR1_CounterClear ( void ) ;
3789 
3790 TMR_PRESCALE
3791  DRV_TMR1_PrescalerGet ( void ) ;
3792 
3793 void
3795  uint32_t value ) ;
3796 
3797 uint32_t
3798  DRV_TMR1_PeriodValueGet ( void ) ;
3799 
3800 void
3801  DRV_TMR1_StopInIdleDisable ( void ) ;
3802 
3803 void
3804  DRV_TMR1_StopInIdleEnable ( void ) ;
3805 
3806 static inline void
3808  {
3809  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 22))); /* 37 */
3810  ((int)(bitmapstruct.element0 |= (1 << 23))); /* 30 */
3811  wl_sps_50zqendz ( 24 ) ; /* 30 */
3812  }
3813 
3814 uint32_t
3815  DRV_TMR1_CounterFrequencyGet ( void ) ;
3816 
3819  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3820 // *****************************************************************************
3821 // *****************************************************************************
3822 // Section: Interface Headers for Instance 2 for the static driver
3823 // *****************************************************************************
3824 // *****************************************************************************
3825 
3826 void
3827  DRV_TMR2_Initialize ( void ) ;
3828 
3829 bool
3830  DRV_TMR2_Start ( void ) ;
3831 
3832 void
3833  DRV_TMR2_Stop ( void ) ;
3834 
3835 static inline void
3837  {
3838  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 24))); /* 37 */
3839  DRV_TMR2_Stop () ;
3840  ((int)(bitmapstruct.element0 |= (1 << 25))); /* 30 */
3841  wl_sps_50zqendz ( 26 ) ; /* 30 */
3842  }
3843 
3844 static inline SYS_STATUS
3846 {
3847  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 26))); /* 37 */
3848  /* Return the status as ready always */
3849  ((int)(bitmapstruct.element0 |= (1 << 27))); /* 30 */
3850  wl_sps_50zqendz ( 28 ) ; /* 30 */
3851  return
3852  SYS_STATUS_READY ;
3853 }
3854 
3855 static inline void
3856  DRV_TMR2_Open ( void )
3857  {
3858  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 28))); /* 37 */
3859  ((int)(bitmapstruct.element0 |= (1 << 29))); /* 30 */
3860  wl_sps_50zqendz ( 30 ) ; /* 30 */
3861  }
3862 
3864  DRV_TMR2_ClientStatus ( void ) ;
3865 
3866 static inline DRV_TMR_OPERATION_MODE
3868 {
3869  int izzqqzz=((int)(bitmapstruct.element0 |= (1 << 30))); /* 37 */
3870  ((int)(bitmapstruct.element0 |= (1 << 31))); /* 30 */
3871  wl_sps_50zqendz ( 32 ) ; /* 30 */
3872  return
3874 }
3875 
3876 static inline void
3878  {
3879  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 0))); /* 37 */
3880  DRV_TMR2_Stop () ;
3881  ((int)(bitmapstruct.element1 |= (1 << 1))); /* 30 */
3882  wl_sps_50zqendz ( 34 ) ; /* 30 */
3883  }
3884 
3885 bool
3887  DRV_TMR_CLK_SOURCES clockSource ,
3888  TMR_PRESCALE prescale ) ;
3889 
3890 void
3892  uint32_t value ) ;
3893 
3894 uint32_t
3895  DRV_TMR2_CounterValueGet ( void ) ;
3896 
3897 void
3898  DRV_TMR2_CounterClear ( void ) ;
3899 
3900 TMR_PRESCALE
3901  DRV_TMR2_PrescalerGet ( void ) ;
3902 
3903 void
3905  uint32_t value ) ;
3906 
3907 uint32_t
3908  DRV_TMR2_PeriodValueGet ( void ) ;
3909 
3910 void
3911  DRV_TMR2_StopInIdleDisable ( void ) ;
3912 
3913 void
3914  DRV_TMR2_StopInIdleEnable ( void ) ;
3915 
3916 static inline void
3918  {
3919  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 2))); /* 37 */
3920  ((int)(bitmapstruct.element1 |= (1 << 3))); /* 30 */
3921  wl_sps_50zqendz ( 36 ) ; /* 30 */
3922  }
3923 
3924 uint32_t
3925  DRV_TMR2_CounterFrequencyGet ( void ) ;
3926 
3929  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
3930 // *****************************************************************************
3931 // *****************************************************************************
3932 // Section: Interface Headers for Instance 3 for the static driver
3933 // *****************************************************************************
3934 // *****************************************************************************
3935 
3936 void
3937  DRV_TMR3_Initialize ( void ) ;
3938 
3939 bool
3940  DRV_TMR3_Start ( void ) ;
3941 
3942 void
3943  DRV_TMR3_Stop ( void ) ;
3944 
3945 static inline void
3947  {
3948  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 4))); /* 37 */
3949  DRV_TMR3_Stop () ;
3950  ((int)(bitmapstruct.element1 |= (1 << 5))); /* 30 */
3951  wl_sps_50zqendz ( 38 ) ; /* 30 */
3952  }
3953 
3954 static inline SYS_STATUS
3956 {
3957  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 6))); /* 37 */
3958  /* Return the status as ready always */
3959  ((int)(bitmapstruct.element1 |= (1 << 7))); /* 30 */
3960  wl_sps_50zqendz ( 40 ) ; /* 30 */
3961  return
3962  SYS_STATUS_READY ;
3963 }
3964 
3965 static inline void
3966  DRV_TMR3_Open ( void )
3967  {
3968  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 8))); /* 37 */
3969  ((int)(bitmapstruct.element1 |= (1 << 9))); /* 30 */
3970  wl_sps_50zqendz ( 42 ) ; /* 30 */
3971  }
3972 
3974  DRV_TMR3_ClientStatus ( void ) ;
3975 
3976 static inline DRV_TMR_OPERATION_MODE
3978 {
3979  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 10))); /* 37 */
3980  ((int)(bitmapstruct.element1 |= (1 << 11))); /* 30 */
3981  wl_sps_50zqendz ( 44 ) ; /* 30 */
3982  return
3984 }
3985 
3986 static inline void
3988  {
3989  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 12))); /* 37 */
3990  DRV_TMR3_Stop () ;
3991  ((int)(bitmapstruct.element1 |= (1 << 13))); /* 30 */
3992  wl_sps_50zqendz ( 46 ) ; /* 30 */
3993  }
3994 
3995 bool
3997  DRV_TMR_CLK_SOURCES clockSource ,
3998  TMR_PRESCALE prescale ) ;
3999 
4000 void
4002  uint32_t value ) ;
4003 
4004 uint32_t
4005  DRV_TMR3_CounterValueGet ( void ) ;
4006 
4007 void
4008  DRV_TMR3_CounterClear ( void ) ;
4009 
4010 TMR_PRESCALE
4011  DRV_TMR3_PrescalerGet ( void ) ;
4012 
4013 void
4015  uint32_t value ) ;
4016 
4017 uint32_t
4018  DRV_TMR3_PeriodValueGet ( void ) ;
4019 
4020 void
4021  DRV_TMR3_StopInIdleDisable ( void ) ;
4022 
4023 void
4024  DRV_TMR3_StopInIdleEnable ( void ) ;
4025 
4026 static inline void
4028  {
4029  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 14))); /* 37 */
4030  ((int)(bitmapstruct.element1 |= (1 << 15))); /* 30 */
4031  wl_sps_50zqendz ( 48 ) ; /* 30 */
4032  }
4033 
4034 uint32_t
4035  DRV_TMR3_CounterFrequencyGet ( void ) ;
4036 
4039  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4040 // *****************************************************************************
4041 // *****************************************************************************
4042 // Section: Interface Headers for Instance 4 for the static driver
4043 // *****************************************************************************
4044 // *****************************************************************************
4045 
4046 void
4047  DRV_TMR4_Initialize ( void ) ;
4048 
4049 bool
4050  DRV_TMR4_Start ( void ) ;
4051 
4052 void
4053  DRV_TMR4_Stop ( void ) ;
4054 
4055 static inline void
4057  {
4058  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 16))); /* 37 */
4059  DRV_TMR4_Stop () ;
4060  ((int)(bitmapstruct.element1 |= (1 << 17))); /* 30 */
4061  wl_sps_50zqendz ( 50 ) ; /* 30 */
4062  }
4063 
4064 static inline SYS_STATUS
4066 {
4067  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 18))); /* 37 */
4068  /* Return the status as ready always */
4069  ((int)(bitmapstruct.element1 |= (1 << 19))); /* 30 */
4070  wl_sps_50zqendz ( 52 ) ; /* 30 */
4071  return
4072  SYS_STATUS_READY ;
4073 }
4074 
4075 static inline void
4076  DRV_TMR4_Open ( void )
4077  {
4078  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 20))); /* 37 */
4079  ((int)(bitmapstruct.element1 |= (1 << 21))); /* 30 */
4080  wl_sps_50zqendz ( 54 ) ; /* 30 */
4081  }
4082 
4084  DRV_TMR4_ClientStatus ( void ) ;
4085 
4086 static inline DRV_TMR_OPERATION_MODE
4088 {
4089  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 22))); /* 37 */
4090  ((int)(bitmapstruct.element1 |= (1 << 23))); /* 30 */
4091  wl_sps_50zqendz ( 56 ) ; /* 30 */
4092  return
4094 }
4095 
4096 static inline void
4098  {
4099  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 24))); /* 37 */
4100  DRV_TMR4_Stop () ;
4101  ((int)(bitmapstruct.element1 |= (1 << 25))); /* 30 */
4102  wl_sps_50zqendz ( 58 ) ; /* 30 */
4103  }
4104 
4105 bool
4107  DRV_TMR_CLK_SOURCES clockSource ,
4108  TMR_PRESCALE prescale ) ;
4109 
4110 void
4112  uint32_t value ) ;
4113 
4114 uint32_t
4115  DRV_TMR4_CounterValueGet ( void ) ;
4116 
4117 void
4118  DRV_TMR4_CounterClear ( void ) ;
4119 
4120 TMR_PRESCALE
4121  DRV_TMR4_PrescalerGet ( void ) ;
4122 
4123 void
4125  uint32_t value ) ;
4126 
4127 uint32_t
4128  DRV_TMR4_PeriodValueGet ( void ) ;
4129 
4130 void
4131  DRV_TMR4_StopInIdleDisable ( void ) ;
4132 
4133 void
4134  DRV_TMR4_StopInIdleEnable ( void ) ;
4135 
4136 static inline void
4138  {
4139  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 26))); /* 37 */
4140  ((int)(bitmapstruct.element1 |= (1 << 27))); /* 30 */
4141  wl_sps_50zqendz ( 60 ) ; /* 30 */
4142  }
4143 
4144 uint32_t
4145  DRV_TMR4_CounterFrequencyGet ( void ) ;
4146 
4149  DRV_TMR_DIVIDER_RANGE * pDivRange ) ;
4150  // #ifndef _DRV_TMR_STATIC_H
4151 /*******************************************************************************
4152  End of File
4153 */
4154 
4155 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\tmr\drv_tmr_static.h*/
4156 /* CLOSE_FILE Include File */
4157 
4158 #include "peripheral/int/plib_int.h"
4159 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h */
4160 /*******************************************************************************
4161  PMP Driver Interface Declarations for Static Single Instance Driver
4162  Company:
4163  Microchip Technology Inc.
4164  File Name:
4165  drv_pmp_static.h
4166  Summary:
4167  PMP driver interface declarations for the static single instance driver.
4168  Description:
4169  The PMP device driver provides a simple interface to manage the PMP
4170  modules on Microchip microcontrollers. This file defines the interface
4171  Declarations for the PMP driver.
4172 
4173  Remarks:
4174  Static interfaces incorporate the driver instance number within the names
4175  of the routines, eliminating the need for an object ID or object handle.
4176 
4177  Static single-open interfaces also eliminate the need for the open handle.
4178 *******************************************************************************/
4179 //DOM-IGNORE-BEGIN
4180 /*******************************************************************************
4181 Copyright (c) 2013 released Microchip Technology Inc. All rights reserved.
4182 Microchip licenses to you the right to use, modify, copy and distribute
4183 Software only when embedded on a Microchip microcontroller or digital signal
4184 controller that is integrated into your product or third party product
4185 (pursuant to the sublicense terms in the accompanying license agreement).
4186 You should refer to the license agreement accompanying this Software for
4187 additional information regarding your rights and obligations.
4188 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4189 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4190 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4191 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4192 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4193 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4194 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4195 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4196 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4197 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4198 *******************************************************************************/
4199 //DOM-IGNORE-END
4200 #ifndef _DRV_PMP_STATIC_H
4201 #define _DRV_PMP_STATIC_H
4202 #include "peripheral/pmp/plib_pmp.h"
4203 // *****************************************************************************
4204 // *****************************************************************************
4205 // Section: Interface Headers for Instance 0 for the static driver
4206 // *****************************************************************************
4207 // *****************************************************************************
4208 
4209 void
4210  DRV_PMP0_Initialize ( void ) ;
4211 
4212 void
4213  DRV_PMP0_ModeConfig ( void ) ;
4214 
4215 void
4217  PMP_DATA_WAIT_STATES dataWait ,
4218  PMP_STROBE_WAIT_STATES strobeWait ,
4219  PMP_DATA_HOLD_STATES dataHold ) ;
4220 
4221 uint8_t
4222  DRV_PMP0_Read ( void ) ;
4223 
4224 void
4225  DRV_PMP0_Write (
4226  uint8_t data ) ;
4227  // #ifndef _DRV_PMP_STATIC_H
4228 /*******************************************************************************
4229  End of File
4230 */
4231 
4232 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\pmp\drv_pmp_static.h*/
4233 /* CLOSE_FILE Include File */
4234 
4235 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h */
4236 /*******************************************************************************
4237  USART Driver Interface Declarations for Static Single Instance Driver
4238  Company:
4239  Microchip Technology Inc.
4240  File Name:
4241  drv_usart_static.h
4242  Summary:
4243  USART driver interface declarations for the static single instance driver.
4244  Description:
4245  The USART device driver provides a simple interface to manage the USART
4246  modules on Microchip microcontrollers. This file defines the interface
4247  Declarations for the USART static driver.
4248  Remarks:
4249  Static interfaces incorporate the driver instance number within the names
4250  of the routines, eliminating the need for an object ID or object handle.
4251  Static single-open interfaces also eliminate the need for the open handle.
4252 *******************************************************************************/
4253 //DOM-IGNORE-BEGIN
4254 /*******************************************************************************
4255 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4256 Microchip licenses to you the right to use, modify, copy and distribute
4257 Software only when embedded on a Microchip microcontroller or digital signal
4258 controller that is integrated into your product or third party product
4259 (pursuant to the sublicense terms in the accompanying license agreement).
4260 You should refer to the license agreement accompanying this Software for
4261 additional information regarding your rights and obligations.
4262 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4263 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4264 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4265 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4266 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4267 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4268 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4269 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4270 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4271 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4272 *******************************************************************************/
4273 //DOM-IGNORE-END
4274 #ifndef _DRV_USART_STATIC_H
4275 #define _DRV_USART_STATIC_H
4276 // *****************************************************************************
4277 // *****************************************************************************
4278 // Section: Included Files
4279 // *****************************************************************************
4280 // *****************************************************************************
4281 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h */
4282 /*******************************************************************************
4283  USART Driver Local Data Structures for static implementation
4284  Company:
4285  Microchip Technology Inc.
4286  File Name:
4287  drv_usart_static_local.h
4288  Summary:
4289  USART Driver Local Data Structures for static implementation
4290  Description:
4291  Driver Local Data Structures for static implementation
4292 *******************************************************************************/
4293 //DOM-IGNORE-BEGIN
4294 /*******************************************************************************
4295 Copyright (c) 2015 released Microchip Technology Inc. All rights reserved.
4296 Microchip licenses to you the right to use, modify, copy and distribute Software
4297 only when embedded on a Microchip microcontroller or digital signal controller
4298 that is integrated into your product or third party product (pursuant to the
4299 sublicense terms in the accompanying license agreement).
4300 You should refer to the license agreement accompanying this Software for
4301 additional information regarding your rights and obligations.
4302 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4303 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4304 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4305 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4306 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4307 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4308 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4309 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4310 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4311 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4312 *******************************************************************************/
4313 //DOM-IGNORE-END
4314 #ifndef _DRV_USART_STATIC_LOCAL_H
4315 #define _DRV_USART_STATIC_LOCAL_H
4316 // *****************************************************************************
4317 // *****************************************************************************
4318 // Section: Included Files
4319 // *****************************************************************************
4320 // *****************************************************************************
4321 #include <stdint.h>
4322 #include <stdbool.h>
4323 #include <stddef.h>
4324 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h */
4325 /*******************************************************************************
4326  USART Driver Interface Header File
4327  Company:
4328  Microchip Technology Inc.
4329  File Name:
4330  drv_usart.h
4331  Summary:
4332  USART Driver Interface Header File
4333  Description:
4334  The USART device driver provides a simple interface to manage the USART or
4335  UART modules on Microchip microcontrollers. This file provides the
4336  interface definition for the USART driver.
4337 *******************************************************************************/
4338 //DOM-IGNORE-BEGIN
4339 /*******************************************************************************
4340 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4341 Microchip licenses to you the right to use, modify, copy and distribute
4342 Software only when embedded on a Microchip microcontroller or digital signal
4343 controller that is integrated into your product or third party product
4344 (pursuant to the sublicense terms in the accompanying license agreement).
4345 You should refer to the license agreement accompanying this Software for
4346 additional information regarding your rights and obligations.
4347 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4348 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4349 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4350 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4351 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4352 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4353 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4354 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4355 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4356 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4357 *******************************************************************************/
4358 //DOM-IGNORE-END
4359 #ifndef _DRV_USART_H
4360 #define _DRV_USART_H
4361 // *****************************************************************************
4362 // *****************************************************************************
4363 // Section: File includes
4364 // *****************************************************************************
4365 // *****************************************************************************
4366 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h */
4367 /*******************************************************************************
4368  USART Driver Definitions Header File
4369  Company:
4370  Microchip Technology Inc.
4371  File Name:
4372  drv_usart_definitions.h
4373  Summary:
4374  USART Driver Definitions Header File
4375  Description:
4376  This file will provide enumerations and other dependencies needed by
4377  USART driver to manage the USART/UART module on PIC32 microcontrollers.
4378 *******************************************************************************/
4379 //DOM-IGNORE-BEGIN
4380 /*******************************************************************************
4381 Copyright (c) 2012-2014 released Microchip Technology Inc. All rights reserved.
4382 Microchip licenses to you the right to use, modify, copy and distribute
4383 Software only when embedded on a Microchip microcontroller or digital signal
4384 controller that is integrated into your product or third party product
4385 (pursuant to the sublicense terms in the accompanying license agreement).
4386 You should refer to the license agreement accompanying this Software for
4387 additional information regarding your rights and obligations.
4388 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
4389 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4390 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4391 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4392 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4393 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4394 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4395 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4396 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4397 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4398 *******************************************************************************/
4399 //DOM-IGNORE-END
4400 #ifndef _DRV_USART_DEFINITIONS_H
4401 #define _DRV_USART_DEFINITIONS_H
4402 // *****************************************************************************
4403 // *****************************************************************************
4404 // Section: File includes
4405 // *****************************************************************************
4406 // *****************************************************************************
4407 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
4408 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" /* LDRA full path */
4409 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h */
4410 /*******************************************************************************
4411  USART Peripheral Library Interface Header
4412  Company:
4413  Microchip Technology Inc.
4414  File Name:
4415  plib_usart.h
4416  Summary:
4417  USART Peripheral Library interface header.
4418  Description:
4419  This header file contains the function prototypes and definitions of
4420  the data types and constants that make up the interface to the USART
4421  Peripheral Library for all families of Microchip microcontrollers. The
4422  functions in this file are common to the USART module.
4423  *******************************************************************************/
4424 // DOM-IGNORE-BEGIN
4425 /*******************************************************************************
4426 Copyright 2010-2015 released Microchip Technology Inc. All rights reserved.
4427 Microchip licenses to you the right to use, modify, copy and distribute
4428 Software only when embedded on a Microchip microcontroller or digital signal
4429 controller that is integrated into your product or third party product
4430 (pursuant to the sublicense terms in the accompanying license agreement).
4431 You should refer to the license agreement accompanying this Software for
4432 additional information regarding your rights and obligations.
4433 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4434 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4435 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4436 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4437 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4438 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4439 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4440 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4441 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4442 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4443  *******************************************************************************/
4444 // DOM-IGNORE-END
4445 #ifndef _PLIB_USART_H
4446 #define _PLIB_USART_H
4447 // DOM-IGNORE-BEGIN
4448 // DOM-IGNORE-END
4449 // ****************************************************************************
4450 // ****************************************************************************
4451 // Section: Included Files
4452 // ****************************************************************************
4453 // ****************************************************************************
4454 /* This section lists the other files that are included in this file.
4455 */
4456 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h */
4457 /*******************************************************************************
4458  Processor Selector File for the USART
4459  Company:
4460  Microchip Technology Incorporated
4461  File Name:
4462  processor.h
4463  Summary:
4464  Selects the appropriate header for the part family
4465  Description:
4466  This file selects the appropriate header for the part family
4467  *******************************************************************************/
4468 // DOM-IGNORE-BEGIN
4469 /*******************************************************************************
4470 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
4471 Microchip licenses to you the right to use, modify, copy and distribute
4472 Software only when embedded on a Microchip microcontroller or digital signal
4473 controller that is integrated into your product or third party product
4474 (pursuant to the sublicense terms in the accompanying license agreement).
4475 You should refer to the license agreement accompanying this Software for
4476 additional information regarding your rights and obligations.
4477 SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
4478 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
4479 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
4480 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
4481 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
4482 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
4483 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
4484 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
4485 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
4486 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
4487  *******************************************************************************/
4488 // DOM-IGNORE-END
4489 #ifndef _USART_PROCESSOR_H
4490 #define _USART_PROCESSOR_H
4491 // *****************************************************************************
4492 // *****************************************************************************
4493 // Section: Included Files
4494 // *****************************************************************************
4495 // *****************************************************************************
4496 /* This section lists the other files that are included in this file.
4497  */
4498 #include <stdint.h>
4499 #include <stdbool.h>
4500 #error "No Processor Family specified"
4501  //
4502  // _USART_PROCESSOR_H
4503 /*******************************************************************************
4504  End of File
4505  */
4506 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\processor\usart_processor.h*/
4507 /* CLOSE_FILE Include File */
4508 
4509 // ****************************************************************************
4510 // ****************************************************************************
4511 // Section: USART Peripheral Library Interface Functions
4512 // ****************************************************************************
4513 // ****************************************************************************
4514 //******************************************************************************
4515 /* Function:
4516  void PLIB_USART_RunInOverflowEnable ( USART_MODULE_ID index )
4517  Summary:
4518  Enables the USART module to continue to operate when an overflow error
4519  condition has occurred.
4520  Description:
4521  This function enables the USART module to continue to operate when an
4522  overflow error condition has occurred.
4523  This operation is atomic.
4524  Precondition:
4525  None.
4526  Parameters:
4527  index - Identifier for the device instance to be configured
4528  Returns:
4529  None.
4530  Example:
4531  <code>
4532 #define MY_USART_INSTANCE USART_ID_1
4533  PLIB_USART_RunInOverflowEnable (MY_USART_INSTANCE);
4534  </code>
4535  Remarks:
4536  This feature may not be available on all devices. Please refer to the
4537  specific device data sheet to determine availability or use
4538  PLIB_USART_ExistsRunInOverflow in your application to determine
4539  whether this feature is available.
4540 */
4541 
4542 void
4544  USART_MODULE_ID index ) ;
4545 //******************************************************************************
4546 /* Function:
4547  void PLIB_USART_RunInOverflowDisable ( USART_MODULE_ID index )
4548  Summary:
4549  Disables the Run in overflow condition mode.
4550  Description:
4551  This function disables the USART module from accepting new data when an overflow
4552  error condition is detected.
4553  This operation is atomic.
4554  Precondition:
4555  None.
4556  Parameters:
4557  index - Identifier for the device instance to be configured
4558  Returns:
4559  None.
4560  Example:
4561  <code>
4562 #define MY_USART_INSTANCE USART_ID_1
4563  PLIB_USART_RunInOverflowDisable (MY_USART_INSTANCE);
4564  </code>
4565  Remarks:
4566  This feature may not be available on all devices. Please refer to the
4567  specific device data sheet to determine availability or use
4568  PLIB_USART_ExistsRunInOverflow in your application to determine
4569  whether this feature is available.
4570 */
4571 
4572 void
4574  USART_MODULE_ID index ) ;
4575 //******************************************************************************
4576 /* Function:
4577  bool PLIB_USART_RunInOverflowIsEnabled ( USART_MODULE_ID index )
4578  Summary:
4579  Gets the status of the Run in Overflow condition.
4580  Description:
4581  This function indicates if the USART module has been enabled to run in
4582  an overflow condition.
4583  This operation is atomic.
4584  Precondition:
4585  None.
4586  Parameters:
4587  index - Identifier for the device instance
4588  Returns:
4589  - true - Run in overflow condition is enabled
4590  - false - Run in overflow condition is disabled
4591  Example:
4592  <code>
4593 #define MY_USART_INSTANCE USART_ID_1
4594  bool status;
4595  status = PLIB_USART_RunInOverflowIsEnabled (MY_USART_INSTANCE);
4596  </code>
4597  Remarks:
4598  This feature may not be available on all devices. Please refer to the
4599  specific device data sheet to determine availability or use
4600  PLIB_USART_ExistsRunInOverflow in your application to determine
4601  whether this feature is available.
4602 */
4603 
4604 bool
4606  USART_MODULE_ID index ) ;
4607 //******************************************************************************
4608 /* Function:
4609  void PLIB_USART_BRGClockSourceSelect
4610  (
4611  USART_MODULE_ID index,
4612  USART_BRG_CLOCK_SOURCE brgClockSource
4613  )
4614  Summary:
4615  Configures the BRG clock source of the USART module.
4616  Description:
4617  This function configures the BRG Clock source of the USART. Refer to
4618  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4619  Precondition:
4620  None.
4621  Parameters:
4622  index - Identifier for the device instance to be configured
4623  brgClockSource - One of the possible values from USART_BRG_CLOCK_SOURCE
4624  Returns:
4625  None.
4626  Example:
4627  <code>
4628 #define MY_USART_INSTANCE USART_ID_1
4629  PLIB_USART_BRGClockSourceSelect (MY_USART_INSTANCE, USART_BRG_CLOCK_SOURCE_FRC_IN_SLEEP);
4630  </code>
4631  Remarks:
4632  This feature may not be available on all devices. Please refer to the
4633  specific device data sheet to determine availability or use
4634  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4635  whether this feature is available.
4636 */
4637 
4638 void
4640  USART_MODULE_ID index ,
4641  USART_BRG_CLOCK_SOURCE brgClockSource ) ;
4642 //******************************************************************************
4643 /* Function:
4644  USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet ( USART_MODULE_ID index )
4645  Summary:
4646  Gets the BRG clock source of the USART module.
4647  Description:
4648  This function returns the BRG Clock source of the USART. Refer to
4649  USART_BRG_CLOCK_SOURCE for the possible clock sources.
4650  This operation is atomic.
4651  Precondition:
4652  None.
4653  Parameters:
4654  index - Identifier for the device instance
4655  Returns:
4656  One of the possible values of USART_BRG_CLOCK_SOURCE
4657  Example:
4658  <code>
4659 #define MY_USART_INSTANCE USART_ID_1
4660  USART_BRG_CLOCK_SOURCE brgClockSource;
4661  brgClockSource = PLIB_USART_BRGClockSourceGet (MY_USART_INSTANCE);
4662  </code>
4663  Remarks:
4664  This feature may not be available on all devices. Please refer to the
4665  specific device data sheet to determine availability or use
4666  PLIB_USART_ExistsBRGClockSourceSelect in your application to determine
4667  whether this feature is available.
4668 */
4669 
4670 USART_BRG_CLOCK_SOURCE
4672  USART_MODULE_ID index ) ;
4673 //******************************************************************************
4674 /* Function:
4675  bool PLIB_USART_ModuleIsBusy ( USART_MODULE_ID index )
4676  Summary:
4677  Returns the USART module's running status.
4678  Description:
4679  This function checks if the USART module status is busy. The following
4680  functions should not be used when the module status is busy:
4681  - PLIB_USART_LineControlModeSelect
4682  - PLIB_USART_BaudRateHighSet
4683  - PLIB_USART_BaudRateHighEnable
4684  - PLIB_USART_BaudRateHighDisable
4685  - PLIB_USART_ReceiverIdleStateLowEnable
4686  - PLIB_USART_ReceiverIdleStateLowDisable
4687  - PLIB_USART_BaudRateAutoDetectEnable
4688  - PLIB_USART_LoopbackEnable
4689  - PLIB_USART_LoopbackDisable
4690  - PLIB_USART_WakeOnStartEnable
4691  - PLIB_USART_WakeOnStartDisable
4692  - PLIB_USART_OperationModeSelect
4693  - PLIB_USART_HandshakeModeSelect
4694  - PLIB_USART_IrDAEnable
4695  - PLIB_USART_IrDADisable
4696  - PLIB_USART_StopInIdleEnable
4697  - PLIB_USART_StopInIdleDisable
4698  - PLIB_USART_RunInOverflowEnable
4699  - PLIB_USART_RunInOverflowDisable
4700  - PLIB_USART_BRGClockSourceSelect
4701  - PLIB_USART_RunInSleepModeEnable
4702  - PLIB_USART_RunInSleepModeDisable
4703  This operation is atomic.
4704  Precondition:
4705  None.
4706  Parameters:
4707  index - Identifier for the device instance
4708  Returns:
4709  - true - USART module is busy
4710  - false - USART module is idle
4711  Example:
4712  <code>
4713 #define MY_USART_INSTANCE USART_ID_1
4714  bool moduleStatus;
4715  moduleStatus = PLIB_USART_ModuleIsBusy (MY_USART_INSTANCE);
4716  </code>
4717  Remarks:
4718  This feature may not be available on all devices. Please refer to the
4719  specific device data sheet to determine availability or use
4720  PLIB_USART_ExistsModuleBusyStatus in your application to determine
4721  whether this feature is available.
4722 */
4723 
4724 bool
4726  USART_MODULE_ID index ) ;
4727 //******************************************************************************
4728 /* Function:
4729  void PLIB_USART_RunInSleepModeEnable ( USART_MODULE_ID index )
4730  Summary:
4731  Allows the USART module's BRG clock to run when the device enters Sleep mode.
4732  Description:
4733  This function enables the USART module's BRG clock to continue operation when
4734  the device enters the Sleep mode.
4735  This operation is atomic.
4736  Precondition:
4737  None.
4738  Parameters:
4739  index - Identifier for the device instance to be configured
4740  Returns:
4741  None.
4742  Example:
4743  <code>
4744 #define MY_USART_INSTANCE USART_ID_1
4745  PLIB_USART_RunInSleepModeEnable (MY_USART_INSTANCE);
4746  </code>
4747  Remarks:
4748  This feature may not be available on all devices. Please refer to the
4749  specific device data sheet to determine availability or use
4750  PLIB_USART_ExistsRunInSleepMode in your application to determine
4751  whether this feature is available.
4752 */
4753 
4754 void
4756  USART_MODULE_ID index ) ;
4757 //******************************************************************************
4758 /* Function:
4759  void PLIB_USART_RunInSleepModeDisable ( USART_MODULE_ID index )
4760  Summary:
4761  Turns off the USART module's BRG clock during Sleep mode.
4762  Description:
4763  This function turns off the USART module's BRG clock during Sleep mode.
4764  This operation is atomic.
4765  Precondition:
4766  None.
4767  Parameters:
4768  index - Identifier for the device instance to be configured
4769  Returns:
4770  None.
4771  Example:
4772  <code>
4773 #define MY_USART_INSTANCE USART_ID_1
4774  PLIB_USART_RunInSleepModeDisable (MY_USART_INSTANCE);
4775  </code>
4776  Remarks:
4777  This feature may not be available on all devices. Please refer to the
4778  specific device data sheet to determine availability or use
4779  PLIB_USART_ExistsRunInSleepMode in your application to determine
4780  whether this feature is available.
4781 */
4782 
4783 void
4785  USART_MODULE_ID index ) ;
4786 //******************************************************************************
4787 /* Function:
4788  bool PLIB_USART_RunInSleepModeIsEnabled ( USART_MODULE_ID index )
4789  Summary:
4790  Gets the status of Run in Sleep mode.
4791  Description:
4792  This function indicates if the USART module has been enabled to run in
4793  Sleep mode.
4794  This operation is atomic.
4795  Precondition:
4796  None.
4797  Parameters:
4798  index - Identifier for the device instance
4799  Returns:
4800  - true - Run in Sleep mode is enabled
4801  - false - Run in Sleep mode is disabled
4802  Example:
4803  <code>
4804 #define MY_USART_INSTANCE USART_ID_1
4805  bool status;
4806  status = PLIB_USART_RunInSleepModeIsEnabled (MY_USART_INSTANCE);
4807  </code>
4808  Remarks:
4809  This feature may not be available on all devices. Please refer to the
4810  specific device data sheet to determine availability or use
4811  PLIB_USART_ExistsRunInSleepMode in your application to determine
4812  whether this feature is available.
4813 */
4814 
4815 bool
4817  USART_MODULE_ID index ) ;
4818 //******************************************************************************
4819 /* Function:
4820  void PLIB_USART_Enable ( USART_MODULE_ID index )
4821  Summary:
4822  Enables the specific USART module.
4823  Description:
4824  This function enables the specific USART module.
4825  This operation is atomic.
4826  Precondition:
4827  None.
4828  Parameters:
4829  index - Identifier for the device instance to be configured
4830  Returns:
4831  None.
4832  Example:
4833  <code>
4834 #define MY_USART_INSTANCE USART_ID_1
4835  PLIB_USART_Enable(MY_USART_INSTANCE);
4836  </code>
4837  Remarks:
4838  By calling this function, the USART pins are controlled by the USART
4839  module.
4840  This feature may not be available on all devices. Please refer to the
4841  specific device data sheet to determine availability or use
4842  PLIB_USART_ExistsEnable in your application to determine whether
4843  this feature is available.
4844 */
4845 
4846 void
4848  USART_MODULE_ID index ) ;
4849 //******************************************************************************
4850 /* Function:
4851  void PLIB_USART_Disable ( USART_MODULE_ID index )
4852  Summary:
4853  Disables the specific USART module
4854  Description:
4855  This function disables the specific USART module.
4856  This operation is atomic.
4857  Precondition:
4858  None.
4859  Parameters:
4860  index - Identifier for the device instance to be configured
4861  Returns:
4862  None.
4863  Example:
4864  <code>
4865 #define MY_USART_INSTANCE USART_ID_1
4866  PLIB_USART_Disable(MY_USART_INSTANCE);
4867  </code>
4868  Remarks:
4869  The default state after any reset for a USART module is the disable state.
4870  If the USART is disabled, all of the related pins are in control of the
4871  general purpose I/O logic.
4872 
4873  Disabling the USART module resets the buffers to empty states. Any data
4874  characters in the buffers are lost and the baud rate is reset. All error
4875  and status bits are also reset.
4876 
4877  Disabling the USART while the USART is active, will abort all pending
4878  transmissions and receptions. Re-enabling the USART will restart the
4879  module in the same configuration.
4880 
4881  When disabled, the USART power consumption is minimal.
4882  This feature may not be available on all devices. Please refer to the
4883  specific device data sheet to determine availability or use
4884  PLIB_USART_ExistsEnable in your application to determine whether
4885  this feature is available.
4886 */
4887 
4888 void
4890  USART_MODULE_ID index ) ;
4891 //******************************************************************************
4892 /* Function:
4893  void PLIB_USART_TransmitterEnable ( USART_MODULE_ID index )
4894  Summary:
4895  Enables the specific USART module transmitter.
4896  Description:
4897  This function enables the specific USART module transmitter.
4898  This operation is atomic.
4899  Precondition:
4900  The USART module should be enabled using the function PLIB_USART_Enable
4901  before this function is called.
4902  Parameters:
4903  index - Identifier for the device instance to be configured
4904  Returns:
4905  None.
4906  Example:
4907  <code>
4908 #define MY_USART_INSTANCE USART_ID_1
4909  PLIB_USART_TransmitterEnable(MY_USART_INSTANCE);
4910  </code>
4911  Remarks:
4912  The transmitter should not be enabled until the USART is enabled.
4913  The transmissions will not be enabled otherwise.
4914 
4915  This feature may not be available on all devices. Please refer to the
4916  specific device data sheet to determine availability or use
4917  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4918  this feature is available.
4919 */
4920 
4921 void
4923  USART_MODULE_ID index ) ;
4924 //******************************************************************************
4925 /* Function:
4926  void PLIB_USART_TransmitterDisable ( USART_MODULE_ID index )
4927  Summary:
4928  Disables the specific USART module transmitter.
4929  Description:
4930  This function disables the specific USART module transmitter.
4931  This operation is atomic.
4932  Precondition:
4933  None.
4934  Parameters:
4935  index - Identifier for the device instance to be configured
4936  Returns:
4937  None.
4938  Example:
4939  <code>
4940 #define MY_USART_INSTANCE USART_ID_1
4941  PLIB_USART_TransmitterDisable(MY_USART_INSTANCE);
4942  </code>
4943  Remarks:
4944  Disabling the transmitter during a transmission will cause the
4945  transmission to be aborted.
4946 
4947  This feature may not be available on all devices. Please refer to the
4948  specific device data sheet to determine availability or use
4949  PLIB_USART_ExistsTransmitterEnable in your application to determine whether
4950  this feature is available.
4951 */
4952 
4953 void
4955  USART_MODULE_ID index ) ;
4956 //******************************************************************************
4957 /* Function:
4958  void PLIB_USART_BaudRateSet ( USART_MODULE_ID index, uint32_t clockFrequency,
4959  uint32_t baudRate );
4960  Summary:
4961  Sets the baud rate to the desired value.
4962  Description:
4963  This function sets the baud rate to the desired value.
4964  Precondition:
4965  None.
4966  Parameters:
4967  index - Identifier for the device instance to be configured
4968  baudRate - Baud Rate Value
4969  clockFrequency - Clock Frequency
4970  Returns:
4971  None.
4972  Example:
4973  <code>
4974 #define MY_USART_INSTANCE USART_ID_1
4975  uint32_t baudRateValue ;
4976  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
4977  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
4978  </code>
4979  Remarks:
4980  Setting a new baud rate value causes the baud rate timer to reset.
4981  This ensures that the baud rate timer does not have to overflow before
4982  outputting the new baud rate.
4983 
4984  If the system clock is changed during an active receive operation, a
4985  receiver error or data loss may result. To avoid this issue verify that
4986  no receptions are in progress before changing the system clock.
4987 
4988  This feature may not be available on all devices. Please refer to the
4989  specific device data sheet to determine availability or use
4990  PLIB_USART_ExistsBaudRate in your application to determine whether
4991  this feature is available.
4992 */
4993 
4994 void
4996  USART_MODULE_ID index ,
4997  uint32_t clockFrequency ,
4998  uint32_t baudRate ) ;
4999 //******************************************************************************
5000 /* Function:
5001  void PLIB_USART_BaudRateHighSet ( USART_MODULE_ID index,
5002  uint32_t clockFrequency, uint32_t baudRate );
5003  Summary:
5004  Sets the baud rate to the desired value.
5005  Description:
5006  This function sets the baud rate to the desired value.
5007  Precondition:
5008  None.
5009  Parameters:
5010  index - Identifier for the device instance to be configured
5011  baudRate - Baud Rate Value, it is the baud rate value
5012  clockFrequency - Clock Frequency
5013  Returns:
5014  None.
5015  Example:
5016  <code>
5017 #define MY_USART_INSTANCE USART_ID_1
5018  uint32_t baudRateValue ;
5019  PLIB_USART_BaudRateHighSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5020  baudRateValue = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5021  </code>
5022  Remarks:
5023  Setting a new baud rate value causes the baud rate timer to reset.
5024  This ensures that the baud rate timer does not have to overflow before
5025  outputting the new baud rate.
5026 
5027  If the system clock is changed during an active receive operation, a
5028  receiver error or data loss may result. To avoid this issue verify that
5029  no receptions are in progress before changing the system clock.
5030 
5031  This feature may not be available on all devices. Please refer to the
5032  specific device data sheet to determine availability or use
5033  PLIB_USART_ExistsBaudRateHigh in your application to determine whether
5034  this feature is available.
5035 */
5036 
5037 void
5039  USART_MODULE_ID index ,
5040  uint32_t clockFrequency ,
5041  uint32_t baudRate ) ;
5042 //******************************************************************************
5043 /* Function:
5044  uint32_t PLIB_USART_BaudRateGet ( USART_MODULE_ID index,
5045  int32_t clockFrequency );
5046  Summary:
5047  Gets the baud rate current in use.
5048  Description:
5049  This function gets the baud rate that is currently in use. The clock frequency
5050  needs to be passed to the function.
5051  Conditions:
5052  None.
5053  Input:
5054  index - Identifier for the device instance to be configured
5055  clockFrequency - Clock Frequency
5056  Returns:
5057  - BaudRate - Baud rate value
5058  Example:
5059  <code>
5060 #define MY_USART_INSTANCE USART_ID_1
5061  uint32_t baudRate ;
5062  PLIB_USART_BaudRateSet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
5063  baudRate = PLIB_USART_BaudRateGet(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY);
5064  </code>
5065  Remarks:
5066  This feature may not be available on all devices. Please refer to the
5067  specific device data sheet to determine availability or use
5068  PLIB_USART_ExistsBaudRate in your application to determine whether
5069  this feature is available.
5070 */
5071 
5072 uint32_t
5074  USART_MODULE_ID index ,
5075  int32_t clockFrequency ) ;
5076 //******************************************************************************
5077 /* Function:
5078  void PLIB_USART_AddressSet
5079  (
5080  USART_MODULE_ID index,
5081  uint8_t address
5082  )
5083  Summary:
5084  Sets the address for the Address Detect mode.
5085  Description:
5086  This function sets the address for the Address Detect mode.
5087  This operation is atomic.
5088  Precondition:
5089  None.
5090  Parameters:
5091  index - Identifier for the device instance to be configured
5092  address - Address
5093  Returns:
5094  None.
5095  Example:
5096  <code>
5097 #define MY_USART_INSTANCE USART_ID_1
5098  uint8_t address = 0x02;
5099  PLIB_USART_AddressSet (MY_USART_INSTANCE, address);
5100  </code>
5101  Remarks:
5102  This feature may not be available on all devices. Please refer to the
5103  specific device data sheet to determine availability or use
5104  PLIB_USART_ExistsReceiverAddress in your application to determine
5105  whether this feature is available.
5106 */
5107 
5108 void
5110  USART_MODULE_ID index ,
5111  uint8_t address ) ;
5112 //******************************************************************************
5113 /* Function:
5114  uint8_t PLIB_USART_AddressGet
5115  (
5116  USART_MODULE_ID index
5117  )
5118  Summary:
5119  Gets the address for the Address Detect mode.
5120  Description:
5121  This function returns the address value being used for the Address
5122  Detect mode.
5123  This operation is atomic.
5124  Precondition:
5125  None.
5126  Parameters:
5127  index - Identifier for the device instance
5128  Returns:
5129  - address - The address being used
5130  Example:
5131  <code>
5132 #define MY_USART_INSTANCE USART_ID_1
5133  uint8_t address = 0;
5134  address = PLIB_USART_AddressGet (MY_USART_INSTANCE);
5135  </code>
5136  Remarks:
5137  This feature may not be available on all devices. Please refer to the
5138  specific device data sheet to determine availability or use
5139  PLIB_USART_ExistsReceiverAddress in your application to determine
5140  whether this feature is available.
5141 */
5142 
5143 uint8_t
5145  USART_MODULE_ID index ) ;
5146 //******************************************************************************
5147 /* Function:
5148  void PLIB_USART_AddressMaskSet
5149  (
5150  USART_MODULE_ID index,
5151  uint8_t mask
5152  )
5153  Summary:
5154  Sets the address mask for the Address Detect mode.
5155  Description:
5156  This function sets the address mask for the Address Detect mode.
5157  This operation is atomic.
5158  Precondition:
5159  None.
5160  Parameters:
5161  index - Identifier for the device instance to be configured
5162  mask - Address match mask bits
5163  Returns:
5164  None.
5165  Example:
5166  <code>
5167 #define MY_USART_INSTANCE USART_ID_1
5168  uint8_t mask = 0x0F;
5169  PLIB_USART_AddressMaskSet (MY_USART_INSTANCE, mask);
5170  </code>
5171  Remarks:
5172  This feature may not be available on all devices. Please refer to the
5173  specific device data sheet to determine availability or use
5174  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5175  whether this feature is available.
5176 */
5177 
5178 void
5180  USART_MODULE_ID index ,
5181  uint8_t mask ) ;
5182 //******************************************************************************
5183 /* Function:
5184  uint8_t PLIB_USART_AddressMaskGet
5185  (
5186  USART_MODULE_ID index
5187  )
5188  Summary:
5189  Gets the address mask for the Address Detect mode.
5190  Description:
5191  This function returns the address mask value being used for the Address
5192  Detect mode.
5193  This operation is atomic.
5194  Precondition:
5195  None.
5196  Parameters:
5197  index - Identifier for the device instance to be configured
5198  Returns:
5199  - mask - Address mask being used
5200  Example:
5201  <code>
5202 #define MY_USART_INSTANCE USART_ID_1
5203  uint8_t mask = 0;
5204  mask = PLIB_USART_AddressMaskGet (MY_USART_INSTANCE);
5205  </code>
5206  Remarks:
5207  This feature may not be available on all devices. Please refer to the
5208  specific device data sheet to determine availability or use
5209  PLIB_USART_ExistsReceiverAddressMask in your application to determine
5210  whether this feature is available.
5211 */
5212 
5213 uint8_t
5215  USART_MODULE_ID index ) ;
5216 //******************************************************************************
5217 /* Function:
5218  void PLIB_USART_ReceiverAddressDetectEnable ( USART_MODULE_ID index )
5219  Summary:
5220  Enables the Address Detect mode.
5221  Description:
5222  This function enables the Address Detect mode. If it is enabled, and the
5223  device is addressed, disable the Address Detect mode to continue receiving
5224  bytes.
5225  This operation is atomic.
5226  Precondition:
5227  None.
5228  Parameters:
5229  index - Identifier for the device instance to be configured
5230  Returns:
5231  None.
5232  Example:
5233  <code>
5234 #define MY_USART_INSTANCE USART_ID_1
5235  PLIB_USART_ReceiverAddressDetectEnable(MY_USART_INSTANCE);
5236  </code>
5237  Remarks:
5238  If 9 data bits are not selected, this bit has no effect.
5239  This feature may not be available on all devices. Please refer to the
5240  specific device data sheet to determine availability or use
5241  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5242  this feature is available.
5243 */
5244 
5245 void
5247  USART_MODULE_ID index ) ;
5248 //******************************************************************************
5249 /* Function:
5250  void PLIB_USART_ReceiverAddressDetectDisable ( USART_MODULE_ID index )
5251  Summary:
5252  Enables the Address Detect mode.
5253  Description:
5254  This function disables the Address Detect mode. If it is enabled, and the
5255  device is addressed, disable the Address Detect mode to continue receiving
5256  bytes.
5257  This operation is atomic.
5258  Precondition:
5259  None.
5260  Parameters:
5261  index - Identifier for the device instance to be configured
5262  Returns:
5263  None.
5264  Example:
5265  <code>
5266 #define MY_USART_INSTANCE USART_ID_1
5267  PLIB_USART_ReceiverAddressDetectDisable(MY_USART_INSTANCE);
5268  </code>
5269  Remarks:
5270  All bytes are received, and the 9th bit can be used as the parity bit.
5271  By default, the address detect is disabled.
5272 
5273  This feature may not be available on all devices. Please refer to the
5274  specific device data sheet to determine availability or use
5275  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5276  this feature is available.
5277 */
5278 
5279 void
5281  USART_MODULE_ID index ) ;
5282 //******************************************************************************
5283 /* Function:
5284  bool PLIB_USART_BaudRateAutoDetectIsComplete ( USART_MODULE_ID index )
5285  Summary:
5286  Gets the state of the automatic baud detection.
5287  Description:
5288  This function gets the state of the automatic baud detection and returns a '0'
5289  if the baud rate auto detection is complete.
5290  This operation is atomic.
5291  Precondition:
5292  None.
5293  Parameters:
5294  index - Identifier for the device instance to be configured
5295  Returns:
5296  - true - Baud rate detection is not complete
5297  - false - Baud rate detection is complete
5298  Example:
5299  <code>
5300 #define MY_USART_INSTANCE USART_ID_1
5301  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5302  // Wait until the baud rate is detected.
5303  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5304  </code>
5305  Remarks:
5306  This feature may not be available on all devices. Please refer to the
5307  specific device data sheet to determine availability or use
5308  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5309  this feature is available.
5310 */
5311 
5312 bool
5314  USART_MODULE_ID index ) ;
5315 //******************************************************************************
5316 /* Function:
5317  void PLIB_USART_BaudRateAutoDetectEnable ( USART_MODULE_ID index )
5318  Summary:
5319  Enables baud rate measurement on the next character, which requires reception
5320  of the Sync character.
5321  Description:
5322  This function enables the baud rate measurement on the next character,
5323  which requires reception of the Sync character.
5324  This operation is atomic.
5325  Precondition:
5326  None.
5327  Parameters:
5328  index - Identifier for the device instance to be configured
5329  Returns:
5330  None.
5331  Example:
5332  <code>
5333 #define MY_USART_INSTANCE USART_ID_1
5334  PLIB_USART_BaudRateAutoDetectEnable(MY_USART_INSTANCE);
5335  // Wait until the baud rate is detected.
5336  while(!PLIB_USART_BaudRateAutoDetectIsComplete(MY_USART_INSTANCE));
5337  </code>
5338  Remarks:
5339  This feature may not be available on all devices. Please refer to the
5340  specific device data sheet to determine availability or use
5341  PLIB_USART_ExistsBaudRateAutoDetect in your application to determine whether
5342  this feature is available.
5343 */
5344 
5345 void
5347  USART_MODULE_ID index ) ;
5348 //******************************************************************************
5349 /* Function:
5350  void PLIB_USART_TransmitterByteSend ( USART_MODULE_ID index, int8_t data )
5351  Summary:
5352  Data to be transmitted in the Byte mode.
5353  Description:
5354  The data is transmitted in the Byte mode for the specified USART module.
5355  This operation is atomic.
5356  Precondition:
5357  None.
5358  Parameters:
5359  index - Identifier for the device instance to be configured
5360  data - Data to be transmitted.
5361  Returns:
5362  None.
5363  Example:
5364  <code>
5365 #define MY_USART_INSTANCE USART_ID_1
5366  uint8_t data = 'a';
5367  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5368  {
5369  PLIB_USART_TransmitterByteSend(MY_USART_INSTANCE, data);
5370  }
5371  </code>
5372  Remarks:
5373  This feature may not be available on all devices. Please refer to the
5374  specific device data sheet to determine availability or use
5375  PLIB_USART_ExistsTransmitter in your application to determine whether
5376  this feature is available.
5377 */
5378 
5379 void
5381  USART_MODULE_ID index ,
5382  int8_t data ) ;
5383 //******************************************************************************
5384 /* Function:
5385  int8_t PLIB_USART_ReceiverByteReceive ( USART_MODULE_ID index )
5386  Summary:
5387  Data to be received in the Byte mode.
5388  Description:
5389  The data to be received in Byte mode from the specified USART module.
5390  This operation is atomic.
5391  Call the functions PLIB_USART_ReceiverFramingErrorHasOccurred,
5392  PLIB_USART_ReceiverParityErrorHasOccurred and
5393  PLIB_USART_ReceiverOverrunHasOccurred to get any error that occurred.
5394  Precondition:
5395  None.
5396  Parameters:
5397  index - Identifier for the device instance to be configured
5398  Returns:
5399  - data - Data to be received
5400  Example:
5401  <code>
5402 #define MY_USART_INSTANCE USART_ID_1
5403  bool isError;
5404  uint8_t mydata;
5405  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5406  {
5407  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5408  }
5409  isError = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE) |
5410  PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE) |
5411  PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE);
5412  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5413  {
5414  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5415  }
5416  </code>
5417  Remarks:
5418  This feature may not be available on all devices. Please refer to the
5419  specific device data sheet to determine availability or use
5420  PLIB_USART_ExistsReceiver in your application to determine whether
5421  this feature is available.
5422 */
5423 
5424 int8_t
5426  USART_MODULE_ID index ) ;
5427 //******************************************************************************
5428 /* Function:
5429  int16_t PLIB_USART_Receiver9BitsReceive ( USART_MODULE_ID index )
5430  Summary:
5431  Data to be received in the byte mode with the 9th bit.
5432  Description:
5433  The data to be received in Byte mode from the specified USART module.
5434  with the 9th bit.
5435  This operation is atomic.
5436  Precondition:
5437  None.
5438  Parameters:
5439  index - Identifier for the device instance to be configured
5440  Returns:
5441  - data - Data to be received
5442  Example:
5443  <code>
5444 #define MY_USART_INSTANCE USART_ID_1
5445  uint16_t mydata;
5446  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5447  {
5448  mydata = PLIB_USART_Receiver9BitsReceive (MY_USART_INSTANCE);
5449  }
5450  </code>
5451  Remarks:
5452  This feature may not be available on all devices. Please refer to the
5453  specific device data sheet to determine availability or use
5454  PLIB_USART_ExistsReceiver9Bits in your application to determine
5455  whether this feature is available.
5456 */
5457 
5458 int16_t
5460  USART_MODULE_ID index ) ;
5461 //******************************************************************************
5462 /* Function:
5463  bool PLIB_USART_ReceiverAddressIsReceived ( USART_MODULE_ID index )
5464  Summary:
5465  Checks and return if the data received is an address.
5466  Description:
5467  Checks and return if the data received is an address. The address has
5468  the 9th bit set. If data received has the 9th bit set, the function returns true;
5469  otherwise, the function returns false.
5470  This operation is atomic.
5471  Precondition:
5472  The USART module should be configured to use the 9 data bits.
5473  Parameters:
5474  index - Identifier for the device instance to be configured
5475  Returns:
5476  - true - if the data received has the 9th bit set
5477  - false - if the address received has the 9th bit cleared
5478  Example:
5479  <code>
5480 #define MY_USART_INSTANCE USART_ID_1
5481  int8_t address;
5482  if(PLIB_USART_ReceiverAddressIsReceived(MY_USART_INSTANCE))
5483  {
5484  address = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5485  }
5486  </code>
5487  Remarks:
5488  This feature may not be available on all devices. Please refer to the
5489  specific device data sheet to determine availability or use
5490  PLIB_USART_ExistsReceiverAddressDetect in your application to determine whether
5491  this feature is available.
5492 */
5493 
5494 bool
5496  USART_MODULE_ID index ) ;
5497 //******************************************************************************
5498 /* Function:
5499  void PLIB_USART_Transmitter9BitsSend ( USART_MODULE_ID index,
5500  int8_t data, bool 9thBit )
5501  Summary:
5502  Data to be transmitted in the byte mode with the 9th bit.
5503  Description:
5504  The data is transmitted in the byte mode for the specified USART module,
5505  with 9th bit.
5506  This operation is atomic.
5507  Precondition:
5508  The USART module should be configured to use the 9 data bits.
5509  Parameters:
5510  index - Identifier for the device instance to be configured
5511  data - Data to be transmitted.
5512  9thBit - 9th bit of the data to be transmitted.
5513  Returns:
5514  None.
5515  Example:
5516  <code>
5517 #define MY_USART_INSTANCE USART_ID_1
5518  uint8_t data = 'a';
5519  if(!PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE))
5520  {
5521  PLIB_USART_Transmitter9BitsSend(MY_USART_INSTANCE, data, false);
5522  }
5523  </code>
5524  Remarks:
5525  This feature may not be available on all devices. Please refer to the
5526  specific device data sheet to determine availability or use
5527  PLIB_USART_ExistsTransmitter9BitsSend in your application to determine whether
5528  this feature is available.
5529 */
5530 
5531 void
5533  USART_MODULE_ID index ,
5534  int8_t data ,
5535  bool Bit9th ) ;
5536 //******************************************************************************
5537 /* Function:
5538  void PLIB_USART_TransmitterBreakSend ( USART_MODULE_ID index )
5539  Summary:
5540  Transmits the break character.
5541  Description:
5542  This function transmits the break character.
5543  This operation is atomic.
5544  Precondition:
5545  The application should wait for the transmitter to be idle, before calling
5546  this function.
5547  Parameters:
5548  index - Identifier for the device instance to be configured
5549  Returns:
5550  None.
5551  Example:
5552  <code>
5553 #define MY_USART_INSTANCE USART_ID_1
5554  // Wait for the Transmit buffer to be empty.
5555  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5556  // Transmit the break character.
5557  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5558  // wait for the break transmission to complete
5559  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5560  </code>
5561  Remarks:
5562  After the break has been transmitted, the application can start
5563  transmitting next bytes.
5564 
5565  This feature may not be available on all devices. Please refer to the
5566  specific device data sheet to determine availability or use
5567  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5568  this feature is available.
5569 */
5570 
5571 void
5573  USART_MODULE_ID index ) ;
5574 //******************************************************************************
5575 /* Function:
5576  bool PLIB_USART_TransmitterBreakSendIsComplete ( USART_MODULE_ID index )
5577  Summary:
5578  Returns the status of the break transmission
5579  Description:
5580  The function returns the status of the break transmission.
5581  This operation is atomic.
5582  Precondition:
5583  None.
5584  Parameters:
5585  index - Identifier for the device instance to be configured
5586  Returns:
5587  - true - Transmit break on the next transmission
5588  - false - Break transmission completed or not started
5589  Example:
5590  <code>
5591 #define MY_USART_INSTANCE USART_ID_1
5592  // Wait for the Transmit buffer to be empty.
5593  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5594  // Transmit the break character.
5595  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5596  // wait for the break transmission to complete
5597  while(!PLIB_USART_TransmitterBreakSendIsComplete(MY_USART_INSTANCE));
5598  </code>
5599  Remarks:
5600  After the break has been transmitted, the application can start
5601  transmitting next bytes.
5602 
5603  This feature may not be available on all devices. Please refer to the
5604  specific device data sheet to determine availability or use
5605  PLIB_USART_ExistsTransmitterBreak in your application to determine whether
5606  this feature is available.
5607 */
5608 
5609 bool
5611  USART_MODULE_ID index ) ;
5612 //******************************************************************************
5613 /* Function:
5614  bool PLIB_USART_ReceiverDataIsAvailable ( USART_MODULE_ID index )
5615  Summary:
5616  Identifies if the receive data is available for the specified USART module.
5617  Description:
5618  This function identifies if the receive data is available for the specified
5619  USART module.
5620  This operation is atomic.
5621  Precondition:
5622  None.
5623  Parameters:
5624  index - Identifier for the device instance to be configured
5625  Returns:
5626  - true - The data is available
5627  - false - The data is not available
5628  Example:
5629  <code>
5630 #define MY_USART_INSTANCE USART_ID_1
5631  int8_t mydata;
5632  if(PLIB_USART_ReceiverDataIsAvailable(MY_USART_INSTANCE))
5633  {
5634  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5635  }
5636  </code>
5637  Remarks:
5638  This feature may not be available on all devices. Please refer to the
5639  specific device data sheet to determine availability or use
5640  PLIB_USART_ExistsReceiverDataAvailableStatus in your application to determine
5641  whether this feature is available.
5642 */
5643 
5644 bool
5646  USART_MODULE_ID index ) ;
5647 //******************************************************************************
5648 /* Function:
5649  void PLIB_USART_ReceiverOverrunErrorClear ( USART_MODULE_ID index )
5650  Summary:
5651  Clears a USART vverrun error.
5652  Description:
5653  This function clears an overrun error. Clearing the error, resets the receive buffer.
5654  This operation is atomic.
5655  Precondition:
5656  None.
5657  Parameters:
5658  index - Identifier for the device instance to be configured
5659  Returns:
5660  None.
5661  Example:
5662  <code>
5663 #define MY_USART_INSTANCE USART_ID_1
5664  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5665  {
5666  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5667  }
5668  </code>
5669  Remarks:
5670  WARNING: Calling this API will clear all of the previously received data.
5671 
5672  This feature may not be available on all devices. Please refer to the
5673  specific device data sheet to determine availability or use
5674  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5675  whether this feature is available.
5676 */
5677 
5678 void
5680  USART_MODULE_ID index ) ;
5681 //******************************************************************************
5682 /* Function:
5683  bool PLIB_USART_TransmitterBufferIsFull ( USART_MODULE_ID index )
5684  Summary:
5685  Gets the transmit buffer full status.
5686  Description:
5687  This function gets the transmit status of the specified USART module.
5688  This operation is atomic.
5689  Precondition:
5690  None.
5691  Parameters:
5692  index - Identifier for the device instance to be configured
5693  Returns:
5694  - true - The transmit buffer is full
5695  - false - The transmit buffer is not full, at least one more
5696  character can be written
5697  Example:
5698  <code>
5699 #define MY_USART_INSTANCE USART_ID_1
5700  // Wait for the Transmit buffer to be empty.
5701  while(PLIB_USART_TransmitterBufferIsFull(MY_USART_INSTANCE));
5702  // Transmit the break character.
5703  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5704  </code>
5705  Remarks:
5706  This feature may not be available on all devices. Please refer to the
5707  specific device data sheet to determine availability or use
5708  PLIB_USART_ExistsTransmitterBufferFullStatus in your application to determine
5709  whether this feature is available.
5710 */
5711 
5712 bool
5714  USART_MODULE_ID index ) ;
5715 //******************************************************************************
5716 /* Function:
5717  bool PLIB_USART_TransmitterIsEmpty ( USART_MODULE_ID index )
5718  Summary:
5719  Gets the transmit shift register empty status.
5720  Description:
5721  This function gets the transmit shift register empty status.
5722  This operation is atomic.
5723  Precondition:
5724  None.
5725  Parameters:
5726  index - Identifier for the device instance to be configured
5727  Returns:
5728  - true - The transmit shift register is empty
5729  - false - The transmit shift register is not empty
5730  Example:
5731  <code>
5732 #define MY_USART_INSTANCE USART_ID_1
5733  // Wait for the Transmit buffer to be empty.
5734  while(!PLIB_USART_TransmitterIsEmpty(MY_USART_INSTANCE));
5735  // Transmit the break character.
5736  PLIB_USART_TransmitterBreakSend(MY_USART_INSTANCE);
5737  </code>
5738  Remarks:
5739  This feature may not be available on all devices. Please refer to the
5740  specific device data sheet to determine availability or use
5741  PLIB_USART_ExistsTransmitterEmptyStatus in your application to determine
5742  whether this feature is available.
5743 */
5744 
5745 bool
5747  USART_MODULE_ID index ) ;
5748 //******************************************************************************
5749 /* Function:
5750  bool PLIB_USART_ReceiverFramingErrorHasOccurred ( USART_MODULE_ID index )
5751  Summary:
5752  Gets the framing error status.
5753  Description:
5754  This function gets the framing error status.
5755  This operation is atomic.
5756  Precondition:
5757  None.
5758  Parameters:
5759  index - Identifier for the device instance to be configured
5760  Returns:
5761  - true - The framing error was detected on the current character
5762  - false - The framing error was not detected on the current
5763  character
5764  Example:
5765  <code>
5766 #define MY_USART_INSTANCE USART_ID_1
5767  status = PLIB_USART_ReceiverFramingErrorHasOccurred(MY_USART_INSTANCE);
5768  </code>
5769  Remarks:
5770  Reading the error clears the error.
5771  This feature may not be available on all devices. Please refer to the
5772  specific device data sheet to determine availability or use
5773  PLIB_USART_ExistsReceiverFramingErrorStatus in your application to determine
5774  whether this feature is available.
5775 */
5776 
5777 bool
5779  USART_MODULE_ID index ) ;
5780 //******************************************************************************
5781 /* Function:
5782  bool PLIB_USART_ReceiverParityErrorHasOccurred ( USART_MODULE_ID index )
5783  Summary:
5784  Gets the parity error status.
5785  Description:
5786  This function gets the parity error status.
5787  This operation is atomic.
5788  Precondition:
5789  None.
5790  Parameters:
5791  index - Identifier for the device instance to be configured
5792  Returns:
5793  - true - The parity error was detected on the current character
5794  - false - The parity error was not detected on the current character
5795  Example:
5796  <code>
5797 #define MY_USART_INSTANCE USART_ID_1
5798  status = PLIB_USART_ReceiverParityErrorHasOccurred(MY_USART_INSTANCE);
5799  </code>
5800  Remarks:
5801  Reading the error clears the error.
5802  A Parity error is irrelevant in case of 9-bit mode.
5803  This feature may not be available on all devices. Please refer to the
5804  specific device data sheet to determine availability or use
5805  PLIB_USART_ExistsReceiverParityErrorStatus in your application to determine
5806  whether this feature is available.
5807 */
5808 
5809 bool
5811  USART_MODULE_ID index ) ;
5812 //******************************************************************************
5813 /* Function:
5814  bool PLIB_USART_ReceiverOverrunHasOccurred ( USART_MODULE_ID index )
5815  Summary:
5816  Identifies if there was a receiver overrun error.
5817  Description:
5818  This function identifies if there was a receiver overrun error.
5819  This operation is atomic.
5820  Precondition:
5821  None.
5822  Parameters:
5823  index - Identifier for the device instance to be configured
5824  Returns:
5825  - true - The receive buffer has overflowed
5826  - false - The receive buffer has not overflowed
5827  Example:
5828  <code>
5829 #define MY_USART_INSTANCE USART_ID_1
5830  if(PLIB_USART_ReceiverOverrunHasOccurred(MY_USART_INSTANCE))
5831  {
5832  PLIB_USART_ReceiverOverrunErrorClear(MY_USART_INSTANCE);
5833  }
5834  </code>
5835  Remarks:
5836  This feature may not be available on all devices. Please refer to the
5837  specific device data sheet to determine availability or use
5838  PLIB_USART_ExistsReceiverOverrunStatus in your application to determine
5839  whether this feature is available.
5840 */
5841 
5842 bool
5844  USART_MODULE_ID index ) ;
5845 //******************************************************************************
5846 /* Function:
5847  bool PLIB_USART_ReceiverIsIdle ( USART_MODULE_ID index )
5848  Summary:
5849  Identifies if the receiver is idle.
5850  Description:
5851  This function identifies if the receiver is idle.
5852  This operation is atomic.
5853  Precondition:
5854  None.
5855  Parameters:
5856  index - Identifier for the device instance to be configured
5857  Returns:
5858  - true - The receive buffer is idle
5859  - false - The receive buffer is not idle
5860  Example:
5861  <code>
5862 #define MY_USART_INSTANCE USART_ID_1
5863  int8_t mydata;
5864  if(PLIB_USART_ReceiverIsIdle(MY_USART_INSTANCE))
5865  {
5866  mydata = PLIB_USART_ReceiverByteReceive(MY_USART_INSTANCE);
5867  }
5868  </code>
5869  Remarks:
5870  This feature may not be available on all devices. Please refer to the
5871  specific device data sheet to determine availability or use
5872  PLIB_USART_ExistsReceiverIdleStatus in your application to determine
5873  whether this feature is available.
5874 */
5875 
5876 bool
5878  USART_MODULE_ID index ) ;
5879 //******************************************************************************
5880 /* Function:
5881  void PLIB_USART_ReceiverEnable ( USART_MODULE_ID index )
5882  Summary:
5883  Enables the USART receiver.
5884  Description:
5885  This function enables the USART receiver.
5886  This operation is atomic.
5887  Precondition:
5888  None.
5889  Parameters:
5890  index - Identifier for the device instance to be configured
5891  Returns:
5892  None.
5893  Example:
5894  <code>
5895 #define MY_USART_INSTANCE USART_ID_1
5896  PLIB_USART_ReceiverEnable(MY_USART_INSTANCE);
5897  </code>
5898  Remarks:
5899  This feature may not be available on all devices. Please refer to the
5900  specific device data sheet to determine availability or use
5901  PLIB_USART_ExistsReceiverEnable in your application to determine
5902  whether this feature is available.
5903 */
5904 
5905 void
5907  USART_MODULE_ID index ) ;
5908 //******************************************************************************
5909 /* Function:
5910  void PLIB_USART_ReceiverDisable ( USART_MODULE_ID index )
5911  Summary:
5912  Disables the USART receiver.
5913  Description:
5914  This function disables the USART receiver.
5915  This operation is atomic.
5916  Precondition:
5917  None.
5918  Parameters:
5919  index - Identifier for the device instance to be configured
5920  Returns:
5921  None.
5922  Example:
5923  <code>
5924 #define MY_USART_INSTANCE USART_ID_1
5925  PLIB_USART_ReceiverDisable(MY_USART_INSTANCE);
5926  </code>
5927  Remarks:
5928  This feature may not be available on all devices. Please refer to the
5929  specific device data sheet to determine availability or use
5930  PLIB_USART_ExistsReceiverEnable in your application to determine
5931  whether this feature is available.
5932 */
5933 
5934 void
5936  USART_MODULE_ID index ) ;
5937 //******************************************************************************
5938 /* Function:
5939  void PLIB_USART_TransmitterIdleIsLowEnable ( USART_MODULE_ID index )
5940  Summary:
5941  Enables the Transmit Idle Low state.
5942  Description:
5943  This function enables the Transmit Idle Low state. In the USART Synchronous
5944  mode, this function configures that the TX polarity, the idle state is low.
5945  When IrDA is enabled, this function sets that IrDA encoded Transmit Idle
5946  state to a '1'.
5947  This operation is atomic.
5948  Precondition:
5949  None.
5950  Parameters:
5951  index - Identifier for the device instance to be configured
5952  Returns:
5953  None.
5954  Example:
5955  <code>
5956 #define MY_USART_INSTANCE USART_ID_1
5957  PLIB_USART_TransmitterIdleIsLowEnable(MY_USART_INSTANCE);
5958  </code>
5959  Remarks:
5960  This feature may not be available on all devices. Please refer to the
5961  specific device data sheet to determine availability or use
5962  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5963  whether this feature is available.
5964 */
5965 
5966 void
5968  USART_MODULE_ID index ) ;
5969 //******************************************************************************
5970 /* Function:
5971  void PLIB_USART_TransmitterIdleIsLowDisable ( USART_MODULE_ID index )
5972  Summary:
5973  Disables the Transmit Idle Low state.
5974  Description:
5975  This function disables the Transmit Idle Low state. In USART Synchronous mode,
5976  this function configures that the TX polarity the idle state is high.
5977  When IrDA is enabled, this function sets the IrDA encoded Transmit Idle
5978  state to a '0'.
5979  This operation is atomic.
5980  Precondition:
5981  None.
5982  Parameters:
5983  index - Identifier for the device instance to be configured
5984  Returns:
5985  None.
5986  Example:
5987  <code>
5988 #define MY_USART_INSTANCE USART_ID_1
5989  PLIB_USART_TransmitterIdleIsLowDisable(MY_USART_INSTANCE);
5990  </code>
5991  Remarks:
5992  This feature may not be available on all devices. Please refer to the
5993  specific device data sheet to determine availability or use
5994  PLIB_USART_ExistsTransmitterIdleIsLow in your application to determine
5995  whether this feature is available.
5996 */
5997 
5998 void
6000  USART_MODULE_ID index ) ;
6001 //******************************************************************************
6002 /* Function:
6003  void PLIB_USART_ReceiverIdleStateLowEnable ( USART_MODULE_ID index )
6004  Summary:
6005  Enables receive polarity inversion.
6006  Description:
6007  This function enables receive polarity inversion. In the USART Synchronous mode,
6008  this function configures that the data is inverted.
6009  This operation is atomic.
6010  Precondition:
6011  None.
6012  Parameters:
6013  index - Identifier for the device instance to be configured
6014  Returns:
6015  None.
6016  Example:
6017  <code>
6018 #define MY_USART_INSTANCE USART_ID_1
6019  PLIB_USART_ReceiverIdleStateLowEnable(MY_USART_INSTANCE);
6020  </code>
6021  Remarks:
6022  This feature may not be available on all devices. Please refer to the
6023  specific device data sheet to determine availability or use
6024  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6025  whether this feature is available.
6026 */
6027 
6028 void
6030  USART_MODULE_ID index ) ;
6031 //******************************************************************************
6032 /* Function:
6033  void PLIB_USART_ReceiverIdleStateLowDisable ( USART_MODULE_ID index );
6034  Summary:
6035  Disables receive polarity inversion.
6036  This operation is atomic.
6037  Description:
6038  This function disables receive polarity inversion. In the USART Synchronous
6039  mode, this function configures that the data is not inverted.
6040  Precondition:
6041  None.
6042  Parameters:
6043  index - Identifier for the device instance to be configured
6044  Returns:
6045  None.
6046  Example:
6047  <code>
6048 #define MY_USART_INSTANCE USART_ID_1
6049  PLIB_USART_ReceiverIdleStateLowDisable(MY_USART_INSTANCE);
6050  </code>
6051  Remarks:
6052  This feature may not be available on all devices. Please refer to the
6053  specific device data sheet to determine availability or use
6054  PLIB_USART_ExistsReceiverIdleStateLowEnable in your application to determine
6055  whether this feature is available.
6056 */
6057 
6058 void
6060  USART_MODULE_ID index ) ;
6061 //******************************************************************************
6062 /* Function:
6063  void PLIB_USART_BaudRateHighEnable ( USART_MODULE_ID index )
6064  Summary:
6065  Enables high baud rate selection.
6066  Description:
6067  This function enables high baud rate selection.
6068  This operation is atomic.
6069  Precondition:
6070  None.
6071  Parameters:
6072  index - Identifier for the device instance to be configured
6073  Returns:
6074  None.
6075  Example:
6076  <code>
6077 #define MY_USART_INSTANCE USART_ID_1
6078  PLIB_USART_BaudRateHighEnable(MY_USART_INSTANCE);
6079  </code>
6080  Remarks:
6081  This feature may not be available on all devices. Please refer to the
6082  specific device data sheet to determine availability or use
6083  PLIB_USART_ExistsBaudRateHigh in your application to determine
6084  whether this feature is available.
6085 */
6086 
6087 void
6089  USART_MODULE_ID index ) ;
6090 //******************************************************************************
6091 /* Function:
6092  void PLIB_USART_BaudRateHighDisable ( USART_MODULE_ID index )
6093  Summary:
6094  Disables the high baud rate selection.
6095  Description:
6096  This function disables the high baud rate selection.
6097  This operation is atomic.
6098  Precondition:
6099  None.
6100  Parameters:
6101  index - Identifier for the device instance to be configured
6102  Returns:
6103  None.
6104  Example:
6105  <code>
6106 #define MY_USART_INSTANCE USART_ID_1
6107  PLIB_USART_BaudRateHighDisable(MY_USART_INSTANCE);
6108  </code>
6109  Remarks:
6110  This feature may not be available on all devices. Please refer to the
6111  specific device data sheet to determine availability or use
6112  PLIB_USART_ExistsBaudRateHigh in your application to determine
6113  whether this feature is available.
6114 */
6115 
6116 void
6118  USART_MODULE_ID index ) ;
6119 //******************************************************************************
6120 /* Function:
6121  void PLIB_USART_TransmitterInterruptModeSelect( USART_MODULE_ID index,
6122  USART_TRANSMIT_INTR_MODE interruptMode )
6123  Summary:
6124  Sets the USART transmitter interrupt mode.
6125  Description:
6126  This function sets the condition in which the USART module should generate
6127  an interrupt.
6128  This operation is atomic.
6129  Precondition:
6130  None.
6131  Parameters:
6132  index - Identifier for the device instance to be configured
6133  interruptMode - Interrupt mode; for possible configurations, refer to
6134  USART_TRANSMIT_INTR_MODE
6135  Returns:
6136  None.
6137  Example:
6138  <code>
6139 #define MY_USART_INSTANCE USART_ID_1
6140  PLIB_USART_TransmitterInterruptModeSelect(MY_USART_INSTANCE,
6141  USART_TRANSMIT_FIFO_EMPTY );
6142  </code>
6143  Remarks:
6144  This feature may not be available on all devices. Please refer to the
6145  specific device data sheet to determine availability or use
6146  PLIB_USART_ExistsTransmitterInterruptMode in your application to determine
6147  whether this feature is available.
6148 */
6149 
6150 void
6152  USART_MODULE_ID index ,
6153  USART_TRANSMIT_INTR_MODE fifolevel ) ;
6154 //******************************************************************************
6155 /* Function:
6156  void PLIB_USART_ReceiverInterruptModeSelect( USART_MODULE_ID index,
6157  USART_RECEIVE_INTR_MODE interruptMode )
6158  Summary:
6159  Sets the USART receiver FIFO level.
6160  Description:
6161  This function sets the USART receiver FIFO level.
6162  This operation is atomic.
6163  Precondition:
6164  None.
6165  Parameters:
6166  index - Identifier for the device instance to be configured
6167  fifolevel - For possible configurations, refer to USART_RECEIVE_INTR_MODE
6168  Returns:
6169  None.
6170  Example:
6171  <code>
6172 #define MY_USART_INSTANCE USART_ID_1
6173  PLIB_USART_ReceiverInterruptModeSelect(MY_USART_INSTANCE,
6174  USART_RECEIVE_FIFO_ONE_CHAR );
6175  </code>
6176  Remarks:
6177  This feature may not be available on all devices. Please refer to the
6178  specific device data sheet to determine availability or use
6179  PLIB_USART_ExistsReceiverInterruptMode in your application to determine
6180  whether this feature is available.
6181 */
6182 
6183 void
6185  USART_MODULE_ID index ,
6186  USART_RECEIVE_INTR_MODE interruptMode ) ;
6187 //******************************************************************************
6188 /* Function:
6189  void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index,
6190  USART_LINECONTROL_MODE dataFlowConfig)
6191  Summary:
6192  Sets the data flow configuration.
6193  Description:
6194  This function sets the USART data flow configuration based on the mask
6195  provided and the specified baud rate.
6196  Precondition:
6197  None.
6198  Parameters:
6199  index - Identifier for the device instance to be configured
6200  mode - For possible data flow configurations, refer to
6201  USART_LINECONTROL_MODE
6202  Returns:
6203  None.
6204  Example:
6205  <code>
6206 #define MY_USART_INSTANCE USART_ID_1
6207  PLIB_USART_LineControlModeSelect(MY_USART_INSTANCE, \
6208  USART_8N1);
6209  </code>
6210  Remarks:
6211  This feature may not be available on all devices. Please refer to the
6212  specific device data sheet to determine availability or use
6213  PLIB_USART_ExistsLineControlMode in your application to determine
6214  whether this feature is available.
6215 */
6216 
6217 void
6219  USART_MODULE_ID index ,
6220  USART_LINECONTROL_MODE dataFlowConfig ) ;
6221 //******************************************************************************
6222 /* Function:
6223  void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index,
6224  USART_HANDSHAKE_MODE handshakeConfig)
6225  Summary:
6226  Sets the data flow configuration.
6227  Description:
6228  This function sets the USART data flow configuration based on the mask
6229  provided and the specified baud rate.
6230  Precondition:
6231  None.
6232  Parameters:
6233  index - Identifier for the device instance to be configured
6234  mode - For possible data flow configurations, refer to
6235  USART_HANDSHAKE_MODE
6236  Returns:
6237  None.
6238  Example:
6239  <code>
6240 #define MY_USART_INSTANCE USART_ID_1
6241  PLIB_USART_HandshakeModeSelect(MY_USART_INSTANCE, \
6242  USART_HANDSHAKE_MODE_SIMPLEX);
6243  </code>
6244  Remarks:
6245  This feature may not be available on all devices. Please refer to the
6246  specific device data sheet to determine availability or use
6247  PLIB_USART_ExistsHandshakeMode in your application to determine
6248  whether this feature is available.
6249 */
6250 
6251 void
6253  USART_MODULE_ID index ,
6254  USART_HANDSHAKE_MODE handshakeConfig ) ;
6255 //******************************************************************************
6256 /* Function:
6257  void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index,
6258  int8_t Mask)
6259  Summary:
6260  Setup the automatic Address Detect mode.
6261  Description:
6262  This function configures the automatic Address Detect mode. Uses the mask as
6263  the address character for automatic address detection.
6264  This operation is atomic.
6265  Precondition:
6266  None.
6267  Parameters:
6268  index - Identifier for the device instance to be configured
6269  Mask - Address character to be used, when enabled
6270  Returns:
6271  None.
6272  Example:
6273  <code>
6274 #define MY_USART_INSTANCE USART_ID_1
6275  PLIB_USART_ReceiverAddressAutoDetectEnable(MY_USART_INSTANCE,
6276  MY_DEVICE_ADDRESS);
6277  </code>
6278  Remarks:
6279  This feature may not be available on all devices. Please refer to the
6280  specific device data sheet to determine availability or use
6281  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6282  whether this feature is available.
6283 */
6284 
6285 void
6287  USART_MODULE_ID index ,
6288  int8_t Mask ) ;
6289 //******************************************************************************
6290 /* Function:
6291  void PLIB_USART_ReceiverAddressAutoDetectDisable (
6292  USART_MODULE_ID index )
6293  Summary:
6294  Disables the automatic Address Detect mode.
6295  Description:
6296  This function disables the automatic Address Detect mode.
6297  This operation is atomic.
6298  Precondition:
6299  None.
6300  Parameters:
6301  index - Identifier for the device instance to be configured
6302  Returns:
6303  None.
6304  Example:
6305  <code>
6306 #define MY_USART_INSTANCE USART_ID_1
6307  PLIB_USART_ReceiverAddressAutoDetectDisable(MY_USART_INSTANCE);
6308  </code>
6309  Remarks:
6310  This feature may not be available on all devices. Please refer to the
6311  specific device data sheet to determine availability or use
6312  PLIB_USART_ExistsReceiverAddressAutoDetect in your application to determine
6313  whether this feature is available.
6314 */
6315 
6316 void
6318  USART_MODULE_ID index ) ;
6319 //******************************************************************************
6320 /* Function:
6321  void PLIB_USART_IrDAEnable ( USART_MODULE_ID index )
6322  Summary:
6323  Enables the IrDA encoder and decoder.
6324  Description:
6325  This function enables the IrDA encoder and decoder.
6326  This operation is atomic.
6327  Precondition:
6328  None.
6329  Parameters:
6330  index - Identifier for the device instance to be configured
6331  Returns:
6332  None.
6333  Example:
6334  <code>
6335 #define MY_USART_INSTANCE USART_ID_1
6336  PLIB_USART_IrDAEnable(MY_USART_INSTANCE);
6337  </code>
6338  Remarks:
6339  This feature may not be available on all devices. Please refer to the
6340  specific device data sheet to determine availability or use
6341  PLIB_USART_ExistsIrDA in your application to determine
6342  whether this feature is available.
6343 */
6344 
6345 void
6347  USART_MODULE_ID index ) ;
6348 //******************************************************************************
6349 /* Function:
6350  void PLIB_USART_IrDADisable ( USART_MODULE_ID index )
6351  Summary:
6352  Disables the IrDA encoder and decoder.
6353  Description:
6354  This function disables the IrDA encoder and decoder.
6355  This operation is atomic.
6356  Precondition:
6357  None.
6358  Parameters:
6359  index - Identifier for the device instance to be configured
6360  Returns:
6361  None.
6362  Example:
6363  <code>
6364 #define MY_USART_INSTANCE USART_ID_1
6365  PLIB_USART_IrDADisable(MY_USART_INSTANCE);
6366  </code>
6367  Remarks:
6368  By default, the IrDA Encoder and Decoder are disabled.
6369 
6370  This feature may not be available on all devices. Please refer to the
6371  specific device data sheet to determine availability or use
6372  PLIB_USART_ExistsIrDA in your application to determine
6373  whether this feature is available.
6374 */
6375 
6376 void
6378  USART_MODULE_ID index ) ;
6379 //******************************************************************************
6380 /* Function:
6381  void PLIB_USART_LoopbackEnable ( USART_MODULE_ID index )
6382  Summary:
6383  Enables Loopback mode.
6384  Description:
6385  This function enables Loopback mode.
6386  This operation is atomic.
6387  Precondition:
6388  None.
6389  Parameters:
6390  index - Identifier for the device instance to be configured
6391  Returns:
6392  None.
6393  Example:
6394  <code>
6395 #define MY_USART_INSTANCE USART_ID_1
6396  PLIB_USART_LoopbackEnable(MY_USART_INSTANCE);
6397  </code>
6398  Remarks:
6399  By default, Loopback mode is disabled.
6400 
6401  This feature may not be available on all devices. Please refer to the
6402  specific device data sheet to determine availability or use
6403  PLIB_USART_ExistsLoopback in your application to determine
6404  whether this feature is available.
6405 */
6406 
6407 void
6409  USART_MODULE_ID index ) ;
6410 //******************************************************************************
6411 /* Function:
6412  void PLIB_USART_LoopbackDisable ( USART_MODULE_ID index )
6413  Summary:
6414  Disables Loopback mode.
6415  Description:
6416  This function disables Loopback mode.
6417  This operation is atomic.
6418  Precondition:
6419  None.
6420  Parameters:
6421  index - Identifier for the device instance to be configured
6422  Returns:
6423  None.
6424  Example:
6425  <code>
6426 #define MY_USART_INSTANCE USART_ID_1
6427  PLIB_USART_LoopbackDisable(MY_USART_INSTANCE);
6428  </code>
6429  Remarks:
6430  By default, Loopback mode is disabled.
6431  This feature may not be available on all devices. Please refer to the
6432  specific device data sheet to determine availability or use
6433  PLIB_USART_ExistsLoopback in your application to determine
6434  whether this feature is available.
6435 */
6436 
6437 void
6439  USART_MODULE_ID index ) ;
6440 //******************************************************************************
6441 /* Function:
6442  void PLIB_USART_OperationModeSelect(USART_MODULE_ID index,
6443  USART_OPERATION_MODE operationmode)
6444  Summary:
6445  Configures the operation mode of the USART module.
6446  Description:
6447  This function configures the operation mode of the USART (i.e., controls the
6448  pins used by the USART module). Refer to USART_OPERATION_MODE for the
6449  possible settings.
6450  Precondition:
6451  None.
6452  Parameters:
6453  index - Identifier for the device instance to be configured
6454  operationmode - One of the possible values from USART_OPERATION_MODE
6455  Returns:
6456  None.
6457  Example:
6458  <code>
6459 #define MY_USART_INSTANCE USART_ID_1
6460  PLIB_USART_OperationModeSelect(MY_USART_INSTANCE, USART_ENABLE_TX_RX_BCLK_USED);
6461  </code>
6462  Remarks:
6463  This feature may not be available on all devices. Please refer to the
6464  specific device data sheet to determine availability or use
6465  PLIB_USART_ExistsOperationMode in your application to determine
6466  whether this feature is available.
6467 */
6468 
6469 void
6471  USART_MODULE_ID index ,
6472  USART_OPERATION_MODE operationmode ) ;
6473 //******************************************************************************
6474 /* Function:
6475  void PLIB_USART_StopInIdleEnable ( USART_MODULE_ID index )
6476  Summary:
6477  Discontinues operation when the device enters Idle mode.
6478  Description:
6479  This function enables the USART module to discontinue operation when the
6480  device enters Idle mode.
6481  This operation is atomic.
6482  Precondition:
6483  None.
6484  Parameters:
6485  index - Identifier for the device instance to be configured
6486  Returns:
6487  None.
6488  Example:
6489  <code>
6490 #define MY_USART_INSTANCE USART_ID_1
6491  PLIB_USART_StopInIdleEnable(MY_USART_INSTANCE);
6492  </code>
6493  Remarks:
6494  This feature may not be available on all devices. Please refer to the
6495  specific device data sheet to determine availability or use
6496  PLIB_USART_ExistsStopInIdle in your application to determine
6497  whether this feature is available.
6498 */
6499 
6500 void
6502  USART_MODULE_ID index ) ;
6503 //******************************************************************************
6504 /* Function:
6505  void PLIB_USART_StopInIdleDisable ( USART_MODULE_ID index )
6506  Summary:
6507  Disables the Stop in Idle mode (the USART module continues operation when
6508  the device is in Idle mode).
6509  Description:
6510  This function disables the Stop in Idle mode. The USART module continues
6511  operation when the device is in Idle mode.
6512  This operation is atomic.
6513  Precondition:
6514  None.
6515  Parameters:
6516  index - Identifier for the device instance to be configured
6517  Returns:
6518  None.
6519  Example:
6520  <code>
6521 #define MY_USART_INSTANCE USART_ID_1
6522  PLIB_USART_StopInIdleDisable(MY_USART_INSTANCE);
6523  </code>
6524  Remarks:
6525  By default, the USART module will continue operation in Idle mode.
6526 
6527  This feature may not be available on all devices. Please refer to the
6528  specific device data sheet to determine availability or use
6529  PLIB_USART_ExistsStopInIdle in your application to determine
6530  whether this feature is available.
6531 */
6532 
6533 void
6535  USART_MODULE_ID index ) ;
6536 //******************************************************************************
6537 /* Function:
6538  void PLIB_USART_WakeOnStartEnable ( USART_MODULE_ID index )
6539  Summary:
6540  Enables the wake-up on start bit detection feature during Sleep mode.
6541  Description:
6542  This function enables the wake-up on start feature during Sleep mode.
6543  This operation is atomic.
6544  Precondition:
6545  None.
6546  Parameters:
6547  index - Identifier for the device instance to be configured
6548  Returns:
6549  None.
6550  Example:
6551  <code>
6552 #define MY_USART_INSTANCE USART_ID_1
6553  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6554  </code>
6555  Remarks:
6556  This feature may not be available on all devices. Please refer to the
6557  specific device data sheet to determine availability or use
6558  PLIB_USART_ExistsWakeOnStart in your application to determine
6559  whether this feature is available.
6560 */
6561 
6562 void
6564  USART_MODULE_ID index ) ;
6565 //******************************************************************************
6566 /* Function:
6567  void PLIB_USART_WakeOnStartDisable ( USART_MODULE_ID index )
6568  Summary:
6569  Disables the wake-up on start bit detection feature during Sleep mode.
6570  Description:
6571  This function disables the wake-up on start bit detection feature during
6572  Sleep mode.
6573  This operation is atomic.
6574  Precondition:
6575  None.
6576  Parameters:
6577  index - Identifier for the device instance to be configured
6578  Returns:
6579  None.
6580  Example:
6581  <code>
6582 #define MY_USART_INSTANCE USART_ID_1
6583  PLIB_USART_WakeOnStartDisable(MY_USART_INSTANCE);
6584  </code>
6585  Remarks:
6586  This feature may not be available on all devices. Please refer to the
6587  specific device data sheet to determine availability or use
6588  PLIB_USART_ExistsWakeOnStart in your application to determine
6589  whether this feature is available.
6590 */
6591 
6592 void
6594  USART_MODULE_ID index ) ;
6595 //******************************************************************************
6596 /* Function:
6597  bool PLIB_USART_WakeOnStartIsEnabled ( USART_MODULE_ID index )
6598  Summary:
6599  Gets the state of the sync break event completion.
6600  Description:
6601  This function returns the status of the sync break event, when called
6602  after enabling using PLIB_USART_WakeOnStartEnable.
6603  This operation is atomic.
6604  Precondition:
6605  None.
6606  Parameters:
6607  index - Identifier for the device instance to be configured
6608  Returns:
6609  None.
6610  Example:
6611  <code>
6612 #define MY_USART_INSTANCE USART_ID_1
6613  //Call the interface just prior to entering the sleep mode.
6614  PLIB_USART_WakeOnStartEnable(MY_USART_INSTANCE);
6615  // Check the status if the Sync break event is over.
6616  if(PLIB_USART_WakeOnStartIsEnabled(MY_USART_INSTANCE))
6617  {
6618  // Do Something
6619  }
6620  </code>
6621  Remarks:
6622  This feature may not be available on all devices. Please refer to the
6623  specific device data sheet to determine availability or use
6624  PLIB_USART_ExistsWakeOnStart in your application to determine
6625  whether this feature is available.
6626 */
6627 
6628 bool
6630  USART_MODULE_ID index ) ;
6631 //******************************************************************************
6632 /* Function:
6633  void PLIB_USART_InitializeModeGeneral( USART_MODULE_ID index, bool autobaud,
6634  bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle );
6635  Summary:
6636  Enables or disables general features of the USART module.
6637  Description:
6638  This function enables or disables general features of the USART module.
6639  Precondition:
6640  None.
6641  Parameters:
6642  index - Identifier for the device instance to be configured
6643  autobaud - If true, auto baud rate detection is enabled. If false
6644  the feature is disabled.
6645  loopBackMode - If true, loop back is enabled. If false the feature is
6646  disabled.
6647  wakeFromSleep - If true, the USART module will wake up the CPU from sleep
6648  mode on USART activity. If false the feature is disabled.
6649  irdaMode - If true, the IrDA mode is enabled. If false the feature
6650  is disabled.
6651  stopInIdle - If true, module will stop functioning when CPU enters Idle
6652  mode. If false, the feature is disabled.
6653  Returns:
6654  None.
6655  Example:
6656  <code>
6657 #define MY_USART_INSTANCE USART_ID_1
6658  // Enable loopback, disable IrDA, disable auto baud detection and disable
6659  // wake from sleep. Enable stop in idle
6660  PLIB_USART_InitializeModeGeneral(MY_USART_INSTANCE, false, true,
6661  false, false, true);
6662  </code>
6663  Remarks:
6664  Enabling the wake from sleep feature will cause the first character that is
6665  received by the USART module to be discarded. This feature should only be
6666  enabled if the CPU is to placed in power saving mode.
6667 
6668  This feature may not be available on all devices. Please refer to the
6669  specific device data sheet to determine availability. Availability of this
6670  function can also be determined if all of the following functions return
6671  true:
6672  - PLIB_USART_ExistsLoopback
6673  - PLIB_USART_ExistsBaudRateAutoDetect
6674  - PLIB_USART_ExistsWakeOnStart
6675  - PLIB_USART_ExistsIrDA
6676  - PLIB_USART_ExistsStopInIdle
6677 */
6678 
6679 void
6681  USART_MODULE_ID index ,
6682  bool autobaud ,
6683  bool loopBackMode ,
6684  bool wakeFromSleep ,
6685  bool irdaMode ,
6686  bool stopInIdle ) ;
6687 //******************************************************************************
6688 /* Function:
6689  void PLIB_USART_InitializeOperation( USART_MODULE_ID index ,
6690  USART_RECEIVE_INTR_MODE receiveInterruptMode,
6691  USART_TRANSMIT_INTR_MODE transmitInterruptMode,
6692  USART_OPERATION_MODE operationMode);
6693  Summary:
6694  Configures the Receive and Transmit FIFO interrupt levels and the hardware
6695  lines to be used by the module.
6696  Description:
6697  This function configures the Receive and Transmit FIFO interrupt levels and
6698  the hardware lines to be used by the module.
6699  Precondition:
6700  None.
6701  Parameters:
6702  index - Identifier for the device instance to be configured
6703  receiveInterruptMode - Receiver FIFO interrupt level
6704  transmitInterruptMode - Transmit FIFO interrupt level
6705  operationMode - Hardware lines to be used by the USART.
6706  Returns:
6707  None.
6708  Example:
6709  <code>
6710 #define MY_USART_INSTANCE USART_ID_1
6711  // Set receive FIFO to interrupt when FIFO is 3/4 level full
6712  // Set Transmit FIFO to interrupt when FIFO is empty
6713  // USART module will only use RX and TX hardware lines
6714  PLIB_USART_InitializeOperation(MY_USART_INSTANCE, USART_RECEIVE_FIFO_3B4FULL,
6715  USART_TRANSMIT_FIFO_EMPTY , USART_ENABLE_TX_RX_USED);
6716  </code>
6717  Remarks:
6718  This feature may not be available on all devices. Please refer to the
6719  specific device data sheet to determine availability. Availability of this
6720  function can also be determined if all of the following functions return
6721  true:
6722  - PLIB_USART_ExistsReceiverInterruptMode
6723  - PLIB_USART_ExistsTransmitterInterruptMode
6724  - PLIB_USART_ExistsOperationMode
6725 */
6726 
6727 void
6729  USART_MODULE_ID index ,
6730  USART_RECEIVE_INTR_MODE receiveInterruptMode ,
6731  USART_TRANSMIT_INTR_MODE transmitInterruptMode ,
6732  USART_OPERATION_MODE operationMode ) ;
6733 //******************************************************************************
6734 /* Function:
6735  void PLIB_USART_BaudSetAndEnable ( USART_MODULE_ID index, uint32_t
6736  clockFrequency, uint32_t baudRate );
6737  Summary:
6738  Sets the baud rate to the desired value and enables the USART receiver,
6739  transmitter and the USART module.
6740  Description:
6741  This function sets the baud rate to the desired value and enables the USART
6742  receiver, USART transmitter and USART module.
6743  Precondition:
6744  None.
6745  Parameters:
6746  index - Identifier for the device instance to be configured
6747  baudRate - Baud Rate Value
6748  clockFrequency - Clock Frequency
6749  Returns:
6750  None.
6751  Example:
6752  <code>
6753 #define MY_USART_INSTANCE USART_ID_1
6754  uint32_t baudRateValue ;
6755  PLIB_USART_BaudSetAndEnable(MY_USART_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
6756  </code>
6757  Remarks:
6758  Setting a new baud rate value causes the baud rate timer to reset.
6759  This ensures that the baud rate timer does not have to overflow before
6760  outputting the new baud rate.
6761 
6762  If the system clock is changed during an active receive operation, a
6763  receiver error or data loss may result. To avoid this issue verify that
6764  no receptions are in progress before changing the system clock.
6765 
6766  This feature may not be available on all devices. Please refer to the
6767  specific device data sheet to determine availability. Availability of this
6768  function can also be determined if all of the following functions return
6769  true:
6770  - PLIB_USART_ExistsBaudRate
6771  - PLIB_USART_ExistsTransmitterEnable
6772  - PLIB_USART_ExistsReceiverEnable
6773  - PLIB_USART_ExistsEnable
6774 */
6775 
6776 void
6778  USART_MODULE_ID index ,
6779  uint32_t systemClock ,
6780  uint32_t baud ) ;
6781 //******************************************************************************
6782 /* Function:
6783  USART_ERROR PLIB_USART_ErrorsGet ( USART_MODULE_ID index )
6784  Summary:
6785  Return the status of all errors in the specified USART module.
6786  Description:
6787  This function returns status of all errors in the specified USART module.
6788  The return value can be bitwise AND'ed with a USART_ERROR type to know the
6789  status of a specific error.
6790  This operation is atomic.
6791  Precondition:
6792  None.
6793  Parameters:
6794  index - Identifier for the device instance to be configured
6795  Returns:
6796  Returns a bitmap of USART error status.
6797  Example:
6798  <code>
6799 #define MY_USART_INSTANCE USART_ID_1
6800  USART_ERROR error;
6801  // Get the status of all errors.
6802  error = PLIB_USART_ErrorsGet(MY_USART_INSTANCE);
6803  // Check if parity error is active
6804  if(error & USART_ERROR_PARITY)
6805  {
6806  // Parity error is active.
6807  }
6808  else if(error & USART_ERROR_FRAMING)
6809  {
6810  // Framing error is active.
6811  }
6812  </code>
6813  Remarks:
6814  This feature may not be available on all devices. Please refer to the
6815  specific device data sheet to determine availability. Availability of this
6816  function can also be determined if all of the followings functions return
6817  true:
6818  - PLIB_USART_ExistsReceiverFramingErrorStatus
6819  - PLIB_USART_ExistsReceiverParityErrorStatus
6820  - PLIB_USART_ExistsReceiverOverrunStatus
6821 */
6822 
6823 USART_ERROR
6825  USART_MODULE_ID index ) ;
6826 //******************************************************************************
6827 /* Function:
6828  PLIB_USART_TransmitterAddressGet( USART_MODULE_ID index )
6829  Summary:
6830  Returns the address of the USART TX register
6831  Description:
6832  This function returns the address of the USART TX register.
6833  This operation is atomic.
6834  Preconditions:
6835  None.
6836  Parameters:
6837  index - Identifier for the device instance
6838  Returns:
6839  Address of the USART TX register
6840  Remarks:
6841  None.
6842 */
6843 
6844 void *
6846  USART_MODULE_ID index ) ;
6847 //******************************************************************************
6848 /* Function:
6849  PLIB_USART_ReceiverAddressGet( USART_MODULE_ID index )
6850  Summary:
6851  Returns the address of the USART RX register
6852  Description:
6853  This function returns the address of the USART RX register.
6854  This operation is atomic.
6855  Preconditions:
6856  None.
6857  Parameters:
6858  index - Identifier for the device instance
6859  Returns:
6860  Address of the USART RX register
6861  Remarks:
6862  None.
6863 */
6864 
6865 void *
6867  USART_MODULE_ID index ) ;
6868 // *****************************************************************************
6869 // *****************************************************************************
6870 // Section: USART Peripheral Library Exists Functions
6871 // *****************************************************************************
6872 // *****************************************************************************
6873 /* The following functions indicate the existence of the features on the device.
6874 */
6875 //******************************************************************************
6876 /* Function:
6877  PLIB_USART_ExistsRunInOverflow ( USART_MODULE_ID index )
6878  Summary:
6879  Identifies whether the Run in overflow condition feature exists on the USART module.
6880  Description:
6881  This function identifies whether the Run in Overflow condition feature is
6882  available on the USART module. When this function returns true, these
6883  functions are supported on the device:
6884  - PLIB_USART_RunInOverflowEnable
6885  - PLIB_USART_RunInOverflowDisable
6886  - PLIB_USART_RunInOverflowIsEnabled
6887  This operation is atomic.
6888  Preconditions:
6889  None.
6890  Parameters:
6891  index - Identifier for the device instance
6892  Returns:
6893  - true - The Run in Overflow condition feature is supported on the device
6894  - false - The Run in Overflow condition feature is not supported on the device
6895  Remarks:
6896  None.
6897 */
6898 
6899 bool
6901  USART_MODULE_ID index ) ;
6902 //******************************************************************************
6903 /* Function:
6904  PLIB_USART_ExistsBRGClockSourceSelect ( USART_MODULE_ID index )
6905  Summary:
6906  Identifies whether the BRG Clock source select feature exists on the
6907  USART module.
6908  Description:
6909  This function identifies whether the BRG Clock source select feature is
6910  available on the USART module. When this function returns true, these
6911  functions are supported on the device:
6912  - PLIB_USART_BRGClockSourceSelect
6913  - PLIB_USART_BRGClockSourceGet
6914  This operation is atomic.
6915  Preconditions:
6916  None.
6917  Parameters:
6918  index - Identifier for the device instance
6919  Returns:
6920  - true - The BRG clock source select feature is supported on the device
6921  - false - The BRG clock source select feature is not supported on the device
6922  Remarks:
6923  None.
6924 */
6925 
6926 bool
6928  USART_MODULE_ID index ) ;
6929 //******************************************************************************
6930 /* Function:
6931  PLIB_USART_ExistsModuleBusyStatus ( USART_MODULE_ID index )
6932  Summary:
6933  Identifies whether the module running status feature exists on the
6934  USART module.
6935  Description:
6936  This function identifies whether the module running status feature is
6937  available on the USART module. When this function returns true, this
6938  function is supported on the device:
6939  - PLIB_USART_ModuleIsBusy
6940  This operation is atomic.
6941  Preconditions:
6942  None.
6943  Parameters:
6944  index - Identifier for the device instance
6945  Returns:
6946  - true - The Module running status feature is supported on the device
6947  - false - The Module running status feature is not supported on the device
6948  Remarks:
6949  None.
6950 */
6951 
6952 bool
6954  USART_MODULE_ID index ) ;
6955 //******************************************************************************
6956 /* Function:
6957  PLIB_USART_ExistsRunInSleepMode ( USART_MODULE_ID index )
6958  Summary:
6959  Identifies whether the Run in Sleep mode feature exists on the USART module.
6960  Description:
6961  This function identifies whether the Run in Sleep mode feature is
6962  available on the USART module. When this function returns true, these
6963  functions are supported on the device:
6964  - PLIB_USART_RunInSleepModeEnable
6965  - PLIB_USART_RunInSleepModeDisable
6966  - PLIB_USART_RunInSleepModeIsEnabled
6967  This operation is atomic.
6968  Preconditions:
6969  None.
6970  Parameters:
6971  index - Identifier for the device instance
6972  Returns:
6973  - true - The Run in Sleep mode feature is supported on the device
6974  - false - The Run in Sleep mode feature is not supported on the device
6975  Remarks:
6976  None.
6977 */
6978 
6979 bool
6981  USART_MODULE_ID index ) ;
6982 //******************************************************************************
6983 /* Function:
6984  PLIB_USART_ExistsEnable( USART_MODULE_ID index )
6985  Summary:
6986  Identifies whether the EnableControl feature exists on the USART module.
6987  Description:
6988  This function identifies whether the EnableControl feature is
6989  available on the USART module. When this function returns true, these
6990  functions are supported on the device:
6991  - PLIB_USART_Disable
6992  - PLIB_USART_Enable
6993  This operation is atomic.
6994  Preconditions:
6995  None.
6996  Parameters:
6997  index - Identifier for the device instance
6998  Returns:
6999  - true - The EnableControl feature is supported on the device
7000  - false - The EnableControl feature is not supported on the device
7001  Remarks:
7002  None.
7003 */
7004 
7005 bool
7007  USART_MODULE_ID index ) ;
7008 //******************************************************************************
7009 /* Function:
7010  PLIB_USART_ExistsHandshakeMode( USART_MODULE_ID index )
7011  Summary:
7012  Identifies whether the HandShakeMode feature exists on the USART module.
7013  Description:
7014  This function identifies whether the HandShakeMode feature is
7015  available on the USART module. When this function returns true, this
7016  function is supported on the device:
7017  - PLIB_USART_HandshakeModeSelect
7018  This operation is atomic.
7019  Preconditions:
7020  None.
7021  Parameters:
7022  index - Identifier for the device instance
7023  Returns:
7024  - true - The HandShakeMode feature is supported on the device
7025  - false - The HandShakeMode feature is not supported on the device
7026  Remarks:
7027  None.
7028 */
7029 
7030 bool
7032  USART_MODULE_ID index ) ;
7033 //******************************************************************************
7034 /* Function:
7035  PLIB_USART_ExistsIrDA( USART_MODULE_ID index )
7036  Summary:
7037  Identifies whether the IrDAControl feature exists on the USART module.
7038  Description:
7039  This function identifies whether the IrDAControl feature is
7040  available on the USART module. When this function returns true, these
7041  functions are supported on the device:
7042  - PLIB_USART_IrDADisable
7043  - PLIB_USART_IrDAEnable
7044  This operation is atomic.
7045  Preconditions:
7046  None.
7047  Parameters:
7048  index - Identifier for the device instance
7049  Returns:
7050  - true - The IrDAControl feature is supported on the device
7051  - false - The IrDAControl feature is not supported on the device
7052  Remarks:
7053  None.
7054 */
7055 
7056 bool
7058  USART_MODULE_ID index ) ;
7059 //******************************************************************************
7060 /* Function:
7061  PLIB_USART_ExistsLineControlMode( USART_MODULE_ID index )
7062  Summary:
7063  Identifies whether the LineControlMode feature exists on the USART module.
7064  Description:
7065  This function identifies whether the LineControlMode feature is
7066  available on the USART module. When this function returns true, this
7067  function is supported on the device:
7068  - PLIB_USART_LineControlModeSelect
7069  This operation is atomic.
7070  Preconditions:
7071  None.
7072  Parameters:
7073  index - Identifier for the device instance
7074  Returns:
7075  - true - The LineControlMode feature is supported on the device
7076  - false - The LineControlMode feature is not supported on the device
7077  Remarks:
7078  None.
7079 */
7080 
7081 bool
7083  USART_MODULE_ID index ) ;
7084 //******************************************************************************
7085 /* Function:
7086  PLIB_USART_ExistsLoopback( USART_MODULE_ID index )
7087  Summary:
7088  Identifies whether the Loopback feature exists on the USART module.
7089  Description:
7090  This function identifies whether the Loopback feature is
7091  available on the USART module. When this function returns true, these
7092  functions are supported on the device:
7093  - PLIB_USART_LoopbackEnable
7094  - PLIB_USART_LoopbackDisable
7095  This operation is atomic.
7096  Preconditions:
7097  None.
7098  Parameters:
7099  index - Identifier for the device instance
7100  Returns:
7101  - true - The Loopback feature is supported on the device
7102  - false - The Loopback feature is not supported on the device
7103  Remarks:
7104  None.
7105 */
7106 
7107 bool
7109  USART_MODULE_ID index ) ;
7110 //******************************************************************************
7111 /* Function:
7112  PLIB_USART_ExistsOperationMode( USART_MODULE_ID index )
7113  Summary:
7114  Identifies whether the OperationMode feature exists on the USART module.
7115  Description:
7116  This function identifies whether the OperationMode feature is
7117  available on the USART module. When this function returns true, this
7118  function is supported on the device:
7119  - PLIB_USART_OperationModeSelect
7120  This operation is atomic.
7121  Preconditions:
7122  None.
7123  Parameters:
7124  index - Identifier for the device instance
7125  Returns:
7126  - true - The OperationMode feature is supported on the device
7127  - false - The OperationMode feature is not supported on the device
7128  Remarks:
7129  None.
7130 */
7131 
7132 bool
7134  USART_MODULE_ID index ) ;
7135 //******************************************************************************
7136 /* Function:
7137  PLIB_USART_ExistsStopInIdle( USART_MODULE_ID index )
7138  Summary:
7139  Identifies whether the StopInIdle feature exists on the USART module.
7140  Description:
7141  This function identifies whether the StopInIdle feature is
7142  available on the USART module. When this function returns true, these
7143  functions are supported on the device:
7144  - PLIB_USART_StopInIdleEnable
7145  - PLIB_USART_StopInIdleDisable
7146  This operation is atomic.
7147  Preconditions:
7148  None.
7149  Parameters:
7150  index - Identifier for the device instance
7151  Returns:
7152  - true - The StopInIdle feature is supported on the device
7153  - false - The StopInIdle feature is not supported on the device
7154  Remarks:
7155  None.
7156 */
7157 
7158 bool
7160  USART_MODULE_ID index ) ;
7161 //******************************************************************************
7162 /* Function:
7163  PLIB_USART_ExistsWakeOnStart( USART_MODULE_ID index )
7164  Summary:
7165  Identifies whether the WakeOnStart feature exists on the USART module.
7166  Description:
7167  This function identifies whether the WakeOnStart feature is
7168  available on the USART module. When this function returns true, these
7169  functions are supported on the device:
7170  - PLIB_USART_WakeOnStartEnable
7171  - PLIB_USART_WakeOnStartDisable
7172  - PLIB_USART_WakeOnStartIsEnabled
7173  This operation is atomic.
7174  Preconditions:
7175  None.
7176  Parameters:
7177  index - Identifier for the device instance
7178  Returns:
7179  - true - The WakeOnStart feature is supported on the device
7180  - false - The WakeOnStart feature is not supported on the device
7181  Remarks:
7182  None.
7183 */
7184 
7185 bool
7187  USART_MODULE_ID index ) ;
7188 //******************************************************************************
7189 /* Function:
7190  PLIB_USART_ExistsBaudRate( USART_MODULE_ID index )
7191  Summary:
7192  Identifies whether the BaudRate feature exists on the USART module.
7193  Description:
7194  This function identifies whether the BaudRate feature is
7195  available on the USART module. When this function returns true, these
7196  functions are supported on the device:
7197  - PLIB_USART_BaudRateSet
7198  - PLIB_USART_BaudRateGet
7199  This operation is atomic.
7200  Preconditions:
7201  None.
7202  Parameters:
7203  index - Identifier for the device instance
7204  Returns:
7205  - true - The BaudRate feature is supported on the device
7206  - false - The BaudRate feature is not supported on the device
7207  Remarks:
7208  None.
7209 */
7210 
7211 bool
7213  USART_MODULE_ID index ) ;
7214 //******************************************************************************
7215 /* Function:
7216  PLIB_USART_ExistsBaudRateAutoDetect( USART_MODULE_ID index )
7217  Summary:
7218  Identifies whether the BaudRateAutoDetect feature exists on the USART module.
7219  Description:
7220  This function identifies whether the BaudRateAutoDetect feature is
7221  available on the USART module. When this function returns true, these
7222  functions are supported on the device:
7223  - PLIB_USART_BaudRateAutoDetectEnable
7224  - PLIB_USART_BaudRateAutoDetectIsComplete
7225  This operation is atomic.
7226  Preconditions:
7227  None.
7228  Parameters:
7229  index - Identifier for the device instance
7230  Returns:
7231  - true - The BaudRateAutoDetect feature is supported on the device
7232  - false - The BaudRateAutoDetect feature is not supported on the device
7233  Remarks:
7234  None.
7235 */
7236 
7237 bool
7239  USART_MODULE_ID index ) ;
7240 //******************************************************************************
7241 /* Function:
7242  PLIB_USART_ExistsBaudRateHigh( USART_MODULE_ID index )
7243  Summary:
7244  Identifies whether the BaudRateHigh feature exists on the USART module.
7245  Description:
7246  This function identifies whether the BaudRateHigh feature is
7247  available on the USART module. When this function returns true, these
7248  functions are supported on the device:
7249  - PLIB_USART_BaudRateHighSet
7250  - PLIB_USART_BaudRateHighDisable
7251  - PLIB_USART_BaudRateHighEnable
7252  This operation is atomic.
7253  Preconditions:
7254  None.
7255  Parameters:
7256  index - Identifier for the device instance
7257  Returns:
7258  - true - The BaudRateHigh feature is supported on the device
7259  - false - The BaudRateHigh feature is not supported on the device
7260  Remarks:
7261  None.
7262 */
7263 
7264 bool
7266  USART_MODULE_ID index ) ;
7267 //******************************************************************************
7268 /* Function:
7269  PLIB_USART_ExistsReceiverAddress ( USART_MODULE_ID index )
7270  Summary:
7271  Identifies whether the Receiver Address feature exists on the USART
7272  module.
7273  Description:
7274  This function identifies whether the Receiver Address feature is
7275  available on the USART module. When this function returns true, these
7276  functions are supported on the device:
7277  - PLIB_USART_AddressSet
7278  - PLIB_USART_AddressGet
7279  This operation is atomic.
7280  Preconditions:
7281  None.
7282  Parameters:
7283  index - Identifier for the device instance
7284  Returns:
7285  - true - The Receiver address feature is supported on the device
7286  - false - The Receiver address feature is not supported on the device
7287  Remarks:
7288  None.
7289 */
7290 
7291 bool
7293  USART_MODULE_ID index ) ;
7294 //******************************************************************************
7295 /* Function:
7296  PLIB_USART_ExistsReceiverAddressMask ( USART_MODULE_ID index )
7297  Summary:
7298  Identifies whether the Receiver Address Mask feature exists on the USART
7299  module.
7300  Description:
7301  This function identifies whether the Receiver Address Mask feature is
7302  available on the USART module. When this function returns true, these
7303  functions are supported on the device:
7304  - PLIB_USART_AddressMaskSet
7305  - PLIB_USART_AddressMaskGet
7306  This operation is atomic.
7307  Preconditions:
7308  None.
7309  Parameters:
7310  index - Identifier for the device instance
7311  Returns:
7312  - true - The Receiver address mask feature is supported on the device
7313  - false - The Receiver address mask feature is not supported on the device
7314  Remarks:
7315  None.
7316 */
7317 
7318 bool
7320  USART_MODULE_ID index ) ;
7321 //******************************************************************************
7322 /* Function:
7323  PLIB_USART_ExistsReceiver( USART_MODULE_ID index )
7324  Summary:
7325  Identifies whether the Receiver feature exists on the USART module.
7326  Description:
7327  This function identifies whether the Receiver feature is available on the
7328  USART module. When this function returns true, these functions are supported
7329  on the device:
7330  - PLIB_USART_ReceiverByteReceive
7331  - PLIB_USART_ReceiverAddressGet
7332  This operation is atomic.
7333  Preconditions:
7334  None.
7335  Parameters:
7336  index - Identifier for the device instance
7337  Returns:
7338  - true - The Receiver feature is supported on the device
7339  - false - The Receiver feature is not supported on the device
7340  Remarks:
7341  None.
7342 */
7343 
7344 bool
7346  USART_MODULE_ID index ) ;
7347 //******************************************************************************
7348 /* Function:
7349  PLIB_USART_ExistsReceiver9Bits ( USART_MODULE_ID index )
7350  Summary:
7351  Identifies whether the 9 Bits Receiver feature exists on the USART module.
7352  Description:
7353  This function identifies whether the 9 Bits Receiver feature is available on the
7354  USART module. When this function returns true, this function is supported
7355  on the device:
7356  - PLIB_USART_Receiver9BitsReceive
7357  This operation is atomic.
7358  Preconditions:
7359  None.
7360  Parameters:
7361  index - Identifier for the device instance
7362  Returns:
7363  - true - The feature is supported on the device
7364  - false - The feature is not supported on the device
7365  Remarks:
7366  None.
7367 */
7368 
7369 bool
7371  USART_MODULE_ID index ) ;
7372 //******************************************************************************
7373 /* Function:
7374  PLIB_USART_ExistsReceiverAddressAutoDetect( USART_MODULE_ID index )
7375  Summary:
7376  Identifies whether the ReceiverAddressAutoDetect feature exists on the USART module.
7377  Description:
7378  This function identifies whether the ReceiverAddressAutoDetect feature is
7379  available on the USART module. When this function returns true, these
7380  functions are supported on the device:
7381  - PLIB_USART_ReceiverAddressAutoDetectEnable
7382  - PLIB_USART_ReceiverAddressAutoDetectDisable
7383  This operation is atomic.
7384  Preconditions:
7385  None.
7386  Parameters:
7387  index - Identifier for the device instance
7388  Returns:
7389  - true - The ReceiverAddressAutoDetect feature is supported on the device
7390  - false - The ReceiverAddressAutoDetect feature is not supported on the device
7391  Remarks:
7392  None.
7393 */
7394 
7395 bool
7397  USART_MODULE_ID index ) ;
7398 //******************************************************************************
7399 /* Function:
7400  PLIB_USART_ExistsReceiverAddressDetect( USART_MODULE_ID index )
7401  Summary:
7402  Identifies whether the ReceiverAddressDetect feature exists on the USART module.
7403  Description:
7404  This function identifies whether the ReceiverAddressDetect feature is
7405  available on the USART module. When this function returns true, these
7406  functions are supported on the device:
7407  - PLIB_USART_ReceiverAddressDetectEnable
7408  - PLIB_USART_ReceiverAddressDetectDisable
7409  - PLIB_USART_ReceiverAddressIsReceived
7410  This operation is atomic.
7411  Preconditions:
7412  None.
7413  Parameters:
7414  index - Identifier for the device instance
7415  Returns:
7416  - true - The ReceiverAddressDetect feature is supported on the device
7417  - false - The ReceiverAddressDetect feature is not supported on the device
7418  Remarks:
7419  None.
7420 */
7421 
7422 bool
7424  USART_MODULE_ID index ) ;
7425 //******************************************************************************
7426 /* Function:
7427  PLIB_USART_ExistsReceiverDataAvailableStatus( USART_MODULE_ID index )
7428  Summary:
7429  Identifies whether the ReceiverDataAvailable feature exists on the USART
7430  module
7431  Description:
7432  This function identifies whether the ReceiverDataAvailable feature is
7433  available on the USART module. When this function returns true, this
7434  function is supported on the device:
7435  - PLIB_USART_ReceiverDataIsAvailable
7436  This operation is atomic.
7437  Preconditions:
7438  None.
7439  Parameters:
7440  index - Identifier for the device instance
7441  Returns:
7442  - true - The ReceiverDataAvailable feature is supported on the device
7443  - false - The ReceiverDataAvailable feature is not supported on the device
7444  Remarks:
7445  None.
7446 */
7447 
7448 bool
7450  USART_MODULE_ID index ) ;
7451 //******************************************************************************
7452 /* Function:
7453  PLIB_USART_ExistsReceiverEnable( USART_MODULE_ID index )
7454  Summary:
7455  Identifies whether the ReceiverEnableControl feature exists on the USART module.
7456  Description:
7457  This function identifies whether the ReceiverEnableControl feature is
7458  available on the USART module. When this function returns true, these
7459  functions are supported on the device:
7460  - PLIB_USART_ReceiverEnable
7461  - PLIB_USART_ReceiverDisable
7462  This operation is atomic.
7463  Preconditions:
7464  None.
7465  Parameters:
7466  index - Identifier for the device instance
7467  Returns:
7468  - true - The ReceiverEnableControl feature is supported on the device
7469  - false - The ReceiverEnableControl feature is not supported on the device
7470  Remarks:
7471  None.
7472 */
7473 
7474 bool
7476  USART_MODULE_ID index ) ;
7477 //******************************************************************************
7478 /* Function:
7479  PLIB_USART_ExistsReceiverIdleStatus( USART_MODULE_ID index )
7480  Summary:
7481  Identifies whether the ReceiverIdle feature exists on the USART module.
7482  Description:
7483  This function identifies whether the ReceiverIdle feature is
7484  available on the USART module. When this function returns true, this
7485  function is supported on the device:
7486  - PLIB_USART_ReceiverIsIdle
7487  This operation is atomic.
7488  Preconditions:
7489  None.
7490  Parameters:
7491  index - Identifier for the device instance
7492  Returns:
7493  - true - The ReceiverIdle feature is supported on the device
7494  - false - The ReceiverIdle feature is not supported on the device
7495  Remarks:
7496  None.
7497 */
7498 
7499 bool
7501  USART_MODULE_ID index ) ;
7502 //******************************************************************************
7503 /* Function:
7504  PLIB_USART_ExistsReceiverFramingErrorStatus( USART_MODULE_ID index )
7505  Summary:
7506  Identifies whether the ReceiverFramingError feature exists on the USART module.
7507  Description:
7508  This function identifies whether the ReceiverFramingError feature is
7509  available on the USART module. When this function returns true, this
7510  function is supported on the device:
7511  - PLIB_USART_ReceiverFramingErrorHasOccurred
7512  This operation is atomic.
7513  Preconditions:
7514  None.
7515  Parameters:
7516  index - Identifier for the device instance
7517  Returns:
7518  - true - The ReceiverFramingError feature is supported on the device
7519  - false - The ReceiverFramingError feature is not supported on the device
7520  Remarks:
7521  None.
7522 */
7523 
7524 bool
7526  USART_MODULE_ID index ) ;
7527 //******************************************************************************
7528 /* Function:
7529  PLIB_USART_ExistsReceiverInterruptMode( USART_MODULE_ID index )
7530  Summary:
7531  Identifies whether the ReceiverInterruptMode feature exists on the USART module.
7532  Description:
7533  This function identifies whether the ReceiverInterruptMode feature is
7534  available on the USART module. When this function returns true, this
7535  function is supported on the device:
7536  - PLIB_USART_ReceiverInterruptModeSelect
7537  This operation is atomic.
7538  Preconditions:
7539  None.
7540  Parameters:
7541  index - Identifier for the device instance
7542  Returns:
7543  - true - The ReceiverInterruptMode feature is supported on the device
7544  - false - The ReceiverInterruptMode feature is not supported on the device
7545  Remarks:
7546  None.
7547 */
7548 
7549 bool
7551  USART_MODULE_ID index ) ;
7552 //******************************************************************************
7553 /* Function:
7554  PLIB_USART_ExistsReceiverIdleStateLowEnable( USART_MODULE_ID index )
7555  Summary:
7556  Identifies whether the ReceiverPolarityInvert feature exists on the USART module.
7557  Description:
7558  This function identifies whether the ReceiverPolarityInvert feature is
7559  available on the USART module. When this function returns true, these
7560  functions are supported on the device:
7561  - PLIB_USART_ReceiverIdleStateLowEnable
7562  - PLIB_USART_ReceiverIdleStateLowDisable
7563  This operation is atomic.
7564  Preconditions:
7565  None.
7566  Parameters:
7567  index - Identifier for the device instance
7568  Returns:
7569  - true - The ReceiverPolarityInvert feature is supported on the device
7570  - false - The ReceiverPolarityInvert feature is not supported on the device
7571  Remarks:
7572  None.
7573 */
7574 
7575 bool
7577  USART_MODULE_ID index ) ;
7578 //******************************************************************************
7579 /* Function:
7580  PLIB_USART_ExistsReceiverParityErrorStatus( USART_MODULE_ID index )
7581  Summary:
7582  Identifies whether the ReceiverParityError feature exists on the USART module.
7583  Description:
7584  This function identifies whether the ReceiverParityError feature is
7585  available on the USART module. When this function returns true, this
7586  function is supported on the device:
7587  - PLIB_USART_ReceiverParityErrorHasOccurred
7588  This operation is atomic.
7589  Preconditions:
7590  None.
7591  Parameters:
7592  index - Identifier for the device instance
7593  Returns:
7594  - true - The ReceiverParityError feature is supported on the device
7595  - false - The ReceiverParityError feature is not supported on the device
7596  Remarks:
7597  None.
7598 */
7599 
7600 bool
7602  USART_MODULE_ID index ) ;
7603 //******************************************************************************
7604 /* Function:
7605  PLIB_USART_ExistsReceiverOverrunStatus( USART_MODULE_ID index )
7606  Summary:
7607  Identifies whether the ReceiverOverrunError feature exists on the USART module.
7608  Description:
7609  This function identifies whether the ReceiverOverrunError feature is
7610  available on the USART module. When this function returns true, these
7611  functions are supported on the device:
7612  - PLIB_USART_ReceiverOverrunErrorClear
7613  - PLIB_USART_ReceiverOverrunHasOccurred
7614  This operation is atomic.
7615  Preconditions:
7616  None.
7617  Parameters:
7618  index - Identifier for the device instance
7619  Returns:
7620  - true - The ReceiverOverrunError feature is supported on the device
7621  - false - The ReceiverOverrunError feature is not supported on the device
7622  Remarks:
7623  None.
7624 */
7625 
7626 bool
7628  USART_MODULE_ID index ) ;
7629 //******************************************************************************
7630 /* Function:
7631  PLIB_USART_ExistsTransmitter( USART_MODULE_ID index )
7632  Summary:
7633  Identifies whether the Transmitter feature exists on the USART module.
7634  Description:
7635  This function identifies whether the Transmitter feature is
7636  available on the USART module. When this function returns true, these
7637  functions are supported on the device:
7638  - PLIB_USART_TransmitterByteSend
7639  - PLIB_USART_TransmitterAddressGet
7640  This operation is atomic.
7641  Preconditions:
7642  None.
7643  Parameters:
7644  index - Identifier for the device instance
7645  Returns:
7646  - true - The Transmitter feature is supported on the device
7647  - false - The Transmitter feature is not supported on the device
7648  Remarks:
7649  None.
7650 */
7651 
7652 bool
7654  USART_MODULE_ID index ) ;
7655 //******************************************************************************
7656 /* Function:
7657  PLIB_USART_ExistsTransmitter9BitsSend( USART_MODULE_ID index )
7658  Summary:
7659  Identifies whether the Transmitter9Bits feature exists on the USART module.
7660  Description:
7661  This function identifies whether the Transmitter9Bits feature is
7662  available on the USART module. When this function returns true, this
7663  function is supported on the device:
7664  - PLIB_USART_Transmitter9BitsSend
7665  This operation is atomic.
7666  Preconditions:
7667  None.
7668  Parameters:
7669  index - Identifier for the device instance
7670  Returns:
7671  - true - The Transmitter9Bits feature is supported on the device
7672  - false - The Transmitter9Bits feature is not supported on the device
7673  Remarks:
7674  None.
7675 */
7676 
7677 bool
7679  USART_MODULE_ID index ) ;
7680 //******************************************************************************
7681 /* Function:
7682  PLIB_USART_ExistsTransmitterBreak( USART_MODULE_ID index )
7683  Summary:
7684  Identifies whether the TransmitterBreak feature exists on the USART module.
7685  Description:
7686  This function identifies whether the TransmitterBreak feature is
7687  available on the USART module. When this function returns true, these
7688  functions are supported on the device:
7689  - PLIB_USART_TransmitterBreakSend
7690  - PLIB_USART_TransmitterBreakSendIsComplete
7691  This operation is atomic.
7692  Preconditions:
7693  None.
7694  Parameters:
7695  index - Identifier for the device instance
7696  Returns:
7697  - true - The TransmitterBreak feature is supported on the device
7698  - false - The TransmitterBreak feature is not supported on the device
7699  Remarks:
7700  None.
7701 */
7702 
7703 bool
7705  USART_MODULE_ID index ) ;
7706 //******************************************************************************
7707 /* Function:
7708  PLIB_USART_ExistsTransmitterBufferFullStatus( USART_MODULE_ID index )
7709  Summary:
7710  Identifies whether the TransmitterBufferFull feature exists on the USART module.
7711  Description:
7712  This function identifies whether the TransmitterBufferFull feature is
7713  available on the USART module. When this function returns true, this
7714  function is supported on the device:
7715  - PLIB_USART_TransmitterBufferIsFull
7716  This operation is atomic.
7717  Preconditions:
7718  None.
7719  Parameters:
7720  index - Identifier for the device instance
7721  Returns:
7722  - true - The TransmitterBufferFull feature is supported on the device
7723  - false - The TransmitterBufferFull feature is not supported on the device
7724  Remarks:
7725  None.
7726 */
7727 
7728 bool
7730  USART_MODULE_ID index ) ;
7731 //******************************************************************************
7732 /* Function:
7733  PLIB_USART_ExistsTransmitterEmptyStatus( USART_MODULE_ID index )
7734  Summary:
7735  Identifies whether the TransmitterEmpty feature exists on the USART module.
7736  Description:
7737  This function identifies whether the TransmitterEmpty feature is
7738  available on the USART module. When this function returns true, this
7739  function is supported on the device:
7740  - PLIB_USART_TransmitterIsEmpty
7741  This operation is atomic.
7742  Preconditions:
7743  None.
7744  Parameters:
7745  index - Identifier for the device instance
7746  Returns:
7747  - true - The TransmitterEmpty feature is supported on the device
7748  - false - The TransmitterEmpty feature is not supported on the device
7749  Remarks:
7750  None.
7751 */
7752 
7753 bool
7755  USART_MODULE_ID index ) ;
7756 //******************************************************************************
7757 /* Function:
7758  PLIB_USART_ExistsTransmitterEnable( USART_MODULE_ID index )
7759  Summary:
7760  Identifies whether the TransmitterEnableControl feature exists on the USART
7761  module
7762  Description:
7763  This function identifies whether the TransmitterEnableControl feature is
7764  available on the USART module. When this function returns true, these
7765  functions are supported on the device:
7766  - PLIB_USART_TransmitterEnable
7767  - PLIB_USART_TransmitterDisable
7768  This operation is atomic.
7769  Preconditions:
7770  None.
7771  Parameters:
7772  index - Identifier for the device instance
7773  Returns:
7774  - true - The TransmitterEnableControl feature is supported on the device
7775  - false - The TransmitterEnableControl feature is not supported on the device
7776  Remarks:
7777  None.
7778 */
7779 
7780 bool
7782  USART_MODULE_ID index ) ;
7783 //******************************************************************************
7784 /* Function:
7785  PLIB_USART_ExistsTransmitterInterruptMode( USART_MODULE_ID index )
7786  Summary:
7787  Identifies whether the TransmitterInterruptMode feature exists on the USART module.
7788  Description:
7789  This function identifies whether the TransmitterInterruptMode feature is
7790  available on the USART module. When this function returns true, this function
7791  is supported on the device:
7792  - PLIB_USART_TransmitterInterruptModeSelect
7793  This operation is atomic.
7794  Preconditions:
7795  None.
7796  Parameters:
7797  index - Identifier for the device instance
7798  Returns:
7799  - true - The TransmitterInterruptMode feature is supported on the device
7800  - false - The TransmitterInterruptMode feature is not supported on the device
7801  Remarks:
7802  None.
7803 */
7804 
7805 bool
7807  USART_MODULE_ID index ) ;
7808 //******************************************************************************
7809 /* Function:
7810  PLIB_USART_ExistsTransmitterIdleIsLow( USART_MODULE_ID index )
7811  Summary:
7812  Identifies whether the TransmitterIdleIsLow feature exists on the USART module.
7813  Description:
7814  This function identifies whether the TransmitterIdleIsLow feature is available
7815  on the USART module. When this function returns true, these functions are
7816  supported on the device:
7817  - PLIB_USART_TransmitterIdleIsLowDisable
7818  - PLIB_USART_TransmitterIdleIsLowEnable
7819  This operation is atomic.
7820  Preconditions:
7821  None.
7822  Parameters:
7823  index - Identifier for the device instance
7824  Returns:
7825  - true - The TransmitterIdleIsLow feature is supported on the device
7826  - false - The TransmitterIdleIsLow feature is not supported on the device
7827  Remarks:
7828  None.
7829 */
7830 
7831 bool
7833  USART_MODULE_ID index ) ;
7834 //DOM-IGNORE-BEGIN
7835 //DOM-IGNORE-END
7836  // #ifndef _PLIB_USART_H
7837 /******************************************************************************
7838  End of File
7839 */
7840 
7841 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\usart\plib_usart.h*/
7842 /* CLOSE_FILE Include File */
7843 
7844 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\system.h */
7845 /*******************************************************************************
7846  System Services Library Interface Header
7847  Company:
7848  Microchip Technology Inc.
7849  File Name:
7850  system.h
7851  Summary:
7852  Top level common system services library interface header.
7853  Description:
7854  This file is the top level common system services library interface header.
7855  It defines (or includes files that define) the common system service
7856  types, prototypes, and other definitions that are commonly used by MPLAB
7857  Harmony libraries and system services.
7858 
7859  System services provide common functionality that would otherwise need to
7860  be duplicated by multiple other modules or that would force them to
7861  interact in complex and hard to manage ways. System services eliminate
7862  conflicts by controlling access shared resources.
7863  Remarks:
7864  The parent directory to the "system" directory should be added to the
7865  compiler's search path for header files such that the following include
7866  statment will successfully include this file.
7867 
7868 #include "system/system.h"
7869  *******************************************************************************/
7870 //DOM-IGNORE-BEGIN
7871 /*******************************************************************************
7872 Copyright (c) 2011-2015 released Microchip Technology Inc. All rights reserved.
7873 Microchip licenses to you the right to use, modify, copy and distribute
7874 Software only when embedded on a Microchip microcontroller or digital signal
7875 controller that is integrated into your product or third party product
7876 (pursuant to the sublicense terms in the accompanying license agreement).
7877 You should refer to the license agreement accompanying this Software for
7878 additional information regarding your rights and obligations.
7879 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
7880 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7881 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7882 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7883 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7884 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7885 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7886 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7887 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7888 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7889  *******************************************************************************/
7890 //DOM-IGNORE-END
7891 #ifndef _SYSTEM_H
7892 #define _SYSTEM_H
7893 // *****************************************************************************
7894 // *****************************************************************************
7895 // Section: Included Files
7896 // *****************************************************************************
7897 // *****************************************************************************
7898 #include "system/common/sys_common.h"
7899 #include "system/common/sys_module.h"
7900 // DOM-IGNORE-BEGIN
7901 // DOM-IGNORE-END
7902 //DOM-IGNORE-BEGIN
7903 //DOM-IGNORE-END
7904  // _SYSTEM_H
7905 /*******************************************************************************
7906  End of File
7907 */
7908 #endif /*00 C:\microchip\harmony\v2_06\framework\system\system.h*/
7909 /* CLOSE_FILE Include File */
7910 
7911 #include "system/int/sys_int.h"
7912 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h */
7913 /*******************************************************************************
7914  DMA System Service Library Interface Definition
7915  Company:
7916  Microchip Technology Inc.
7917  File Name:
7918  sys_dma.h
7919  Summary:
7920  DMA System Service.
7921  Description:
7922  This file contains the interface definition for the DMA System
7923  Service. It provides a way to interact with the DMA subsystem to
7924  manage the data transfer between different peripherals and/or memory
7925  without intervention from the CPU.
7926 *******************************************************************************/
7927 //DOM-IGNORE-BEGIN
7928 /*******************************************************************************
7929 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7930 Microchip licenses to you the right to use, modify, copy and distribute
7931 Software only when embedded on a Microchip microcontroller or digital signal
7932 controller that is integrated into your product or third party product
7933 (pursuant to the sublicense terms in the accompanying license agreement).
7934 You should refer to the license agreement accompanying this Software for
7935 additional information regarding your rights and obligations.
7936 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7937 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7938 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7939 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7940 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7941 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7942 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7943 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7944 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7945 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7946 *******************************************************************************/
7947 //DOM-IGNORE-END
7948 #ifndef _SYS_DMA_H
7949 #define _SYS_DMA_H
7950 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h */
7951 /*******************************************************************************
7952  DMA System Service Library Interface Definition
7953  Company:
7954  Microchip Technology Inc.
7955  File Name:
7956  sys_dma_definitions.h
7957  Summary:
7958  DMA System Service data type definitions header.
7959  Description:
7960  This file contains data type definitions header.
7961 *******************************************************************************/
7962 //DOM-IGNORE-BEGIN
7963 /*******************************************************************************
7964 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
7965 Microchip licenses to you the right to use, modify, copy and distribute
7966 Software only when embedded on a Microchip microcontroller or digital signal
7967 controller that is integrated into your product or third party product
7968 (pursuant to the sublicense terms in the accompanying license agreement).
7969 You should refer to the license agreement accompanying this Software for
7970 additional information regarding your rights and obligations.
7971 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
7972 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
7973 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
7974 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
7975 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
7976 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
7977 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
7978 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
7979 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
7980 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
7981 *******************************************************************************/
7982 //DOM-IGNORE-END
7983 #ifndef _SYS_DMA_DEFINITIONS_H
7984 #define _SYS_DMA_DEFINITIONS_H
7985 // *****************************************************************************
7986 // *****************************************************************************
7987 // Section: File includes
7988 // *****************************************************************************
7989 // *****************************************************************************
7990 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
7991 #include "system/common/sys_common.h"
7992 #include "system/common/sys_module.h"
7993 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h */
7994 /*******************************************************************************
7995  DMA Peripheral Library Interface Header
7996  Company:
7997  Microchip Technology Inc.
7998  File Name:
7999  plib_dma.h
8000  Summary:
8001  Defines the DMA Peripheral Library interface functions.
8002  Description:
8003  This header file contains the function prototypes and definitions of
8004  the data types and constants that make up the interface to the Direct Memory
8005  Access (DMA) Peripheral Library for Microchip microcontrollers. The
8006  definitions in this file are for the DMA module.
8007 *******************************************************************************/
8008 // DOM-IGNORE-BEGIN
8009 /*******************************************************************************
8010 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
8011 Microchip licenses to you the right to use, modify, copy and distribute
8012 Software only when embedded on a Microchip microcontroller or digital signal
8013 controller that is integrated into your product or third party product
8014 (pursuant to the sublicense terms in the accompanying license agreement).
8015 You should refer to the license agreement accompanying this Software for
8016 additional information regarding your rights and obligations.
8017 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
8018 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8019 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8020 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8021 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8022 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8023 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8024 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8025 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8026 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8027 *******************************************************************************/
8028 // DOM-IGNORE-END
8029 #ifndef _PLIB_DMA_H
8030 #define _PLIB_DMA_H
8031 // DOM-IGNORE-BEGIN
8032 // DOM-IGNORE-END
8033 // *****************************************************************************
8034 // *****************************************************************************
8035 // Section: Includes
8036 // *****************************************************************************
8037 // *****************************************************************************
8038 /* See Bottom of file for implementation header include files.
8039 */
8040 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h */
8041 //DOM-IGNORE-BEGIN
8042 /*******************************************************************************
8043 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
8044 Microchip licenses to you the right to use, modify, copy and distribute
8045 Software only when embedded on a Microchip microcontroller or digital signal
8046 controller that is integrated into your product or third party product
8047 (pursuant to the sublicense terms in the accompanying license agreement).
8048 You should refer to the license agreement accompanying this Software for
8049 additional information regarding your rights and obligations.
8050 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
8051 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
8052 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
8053 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
8054 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
8055 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
8056 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
8057 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
8058 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
8059 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
8060  *******************************************************************************/
8061 //DOM-IGNORE-END
8062 #ifndef _PLIB_DMA_PROCESSOR_H
8063 #define _PLIB_DMA_PROCESSOR_H
8064 #error "Can't find header"
8065 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\processor\dma_processor.h*/
8066 /* CLOSE_FILE Include File */
8067 
8068 // *****************************************************************************
8069 // *****************************************************************************
8070 // Section: Peripheral Library Interface Functions
8071 // *****************************************************************************
8072 // *****************************************************************************
8073 // *****************************************************************************
8074 // *****************************************************************************
8075 // Section: DMA Channel Status Functions
8076 // *****************************************************************************
8077 // *****************************************************************************
8078 //******************************************************************************
8079 /* Function:
8080  bool PLIB_DMA_ChannelXBufferedDataIsWritten ( DMA_MODULE_ID index,
8081  DMA_CHANNEL channel )
8082  Summary:
8083  Returns the buffered data write status for the specified channel.
8084  Description:
8085  This function returns the buffered data write status for the specified channel.
8086  Precondition:
8087  None.
8088  Parameters:
8089  channel - One of the existing DMA channels listed by DMA_CHANNEL
8090  Returns:
8091  - true - The content of the DMA buffer has not been written to the location
8092  specified in the destination/source address or in Null Write mode
8093  - false - The content of the DMA buffer has been written to the location
8094  specified in the destination/source address or in Null Write mode
8095  Example:
8096  <code>
8097  bool chBuffWriteStatus;
8098  chBuffWriteStatus = PLIB_DMA_ChannelXBufferedDataIsWritten( DMA_ID_0,
8099  DMA_CHANNEL_3 );
8100  </code>
8101  Remarks:
8102  This feature is not available on all devices. Please refer to the specific device
8103  data sheet to determine availability.
8104 */
8105 
8106 bool
8108  DMA_MODULE_ID index ,
8109  DMA_CHANNEL channel ) ;
8110 /*******************************************************************************
8111  Function:
8112  bool PLIB_DMA_ChannelXCollisionStatus ( DMA_MODULE_ID index,
8113  DMA_CHANNEL channel,
8114  DMA_CHANNEL_COLLISION collisonType )
8115  Summary:
8116  Returns the status of the specified collision type for the specified channel.
8117  Description:
8118  This function returns the status of the specified collision type for the
8119  specified channel.
8120  Precondition:
8121  None.
8122  Parameters:
8123  channel - One of the existing DMA channels listed by DMA_CHANNEL
8124  collisonType - Collision type listed by DMA_CHANNEL_COLLISION
8125  Returns:
8126  - true - A collision specified by collisonType was detected
8127  - false - No collision of type collisonType was detected
8128  Example:
8129  <code>
8130  bool memWriteCollisionStatus;
8131  memWriteCollisionStatus = PLIB_DMA_ChannelXMemoryWriteCollisionStatus(
8132  DMA_ID_0,
8133  DMA_CHANNEL_3,
8134  DMA_CHANNEL_COLLISION_MEMORY );
8135  </code>
8136  Remarks:
8137  This feature is not available on all devices. Please refer to the specific
8138  device data sheet to determine availability.
8139 */
8140 
8141 bool
8143  DMA_MODULE_ID index ,
8144  DMA_CHANNEL channel ,
8145  DMA_CHANNEL_COLLISION collisonType ) ;
8146 //******************************************************************************
8147 /* Function:
8148  DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet( DMA_MODULE_ID index,
8149  DMA_CHANNEL channel )
8150  Summary:
8151  Returns the Ping-Pong mode status for the specified channel.
8152  Description:
8153  This function returns the Ping-Pong mode status for the specified channel.
8154  Precondition:
8155  None.
8156  Parameters:
8157  channel - One of the existing DMA channels listed by DMA_CHANNEL
8158  Returns:
8159  mode - One of the possible Ping-Pong modes
8160  Example:
8161  <code>
8162  DMA_PING_PONG_MODE chPingPongStatus;
8163  chPingPongStatus = PLIB_DMA_ChannelXPingPongModeGet(DMA_ID_0,
8164  DMA_CHANNEL_3 );
8165  if (DMA_PING_PONG_SECONDARY == chPingPongStatus)
8166  {
8167  \\Application
8168  }
8169  </code>
8170  Remarks:
8171  This feature is not available on all devices. Please refer to the specific
8172  device data sheet to determine availability.
8173 */
8174 
8175 DMA_PING_PONG_MODE
8177  DMA_MODULE_ID index ,
8178  DMA_CHANNEL channel ) ;
8179 //******************************************************************************
8180 /* Function:
8181  bool PLIB_DMA_ChannelXEventIsDetected ( DMA_MODULE_ID index,
8182  DMA_CHANNEL channel )
8183  Summary:
8184  Returns the event status on the specified channel.
8185  Description:
8186  This function returns the event status on the specified channel.
8187  Precondition:
8188  None.
8189  Parameters:
8190  channel - One of the possible DMA channels listed by DMA_CHANNEL
8191  Returns:
8192  - true - An event was detected
8193  - false - No events were detected
8194  Example:
8195  <code>
8196  bool channeleventStatus;
8197  channeleventStatus = PLIB_DMA_ChannelXEventIsDetected( DMA_ID_0,
8198  DMA_CHANNEL_2 );
8199  </code>
8200  Remarks:
8201  This function implements an operation of the ChannelXEvent feature.
8202  This feature may not be available on all devices. Please refer to the
8203  specific device data sheet to determine availability or include the
8204  PLIB_DMA_ExistsChannelXEvent function in your application to determine
8205  whether this feature is available.
8206 */
8207 
8208 bool
8210  DMA_MODULE_ID index ,
8211  DMA_CHANNEL channel ) ;
8212 // *****************************************************************************
8213 // *****************************************************************************
8214 // Section: DMA Channel Configuration Functions
8215 // *****************************************************************************
8216 // *****************************************************************************
8217 //******************************************************************************
8218 /* Function:
8219  void PLIB_DMA_ChannelXPrioritySelect ( DMA_MODULE_ID index,
8220  DMA_CHANNEL channel,
8221  DMA_CHANNEL_PRIORITY channelPriority )
8222  Summary:
8223  Sets the priority of the specified channel.
8224  Description:
8225  This function sets the priority of the specified channel.
8226  Precondition:
8227  None.
8228  Parameters:
8229  channel - One of the existing DMA channels listed by DMA_CHANNEL
8230  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8231  Returns:
8232  None.
8233  Example:
8234  <code>
8235  DMA_CHANNEL channel = DMA_CHANNEL_0;
8236  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_PRIORITY_3;
8237  PLIB_DMA_ChannelXPrioritySelect( DMA_ID_0, channel, channelPriority );
8238  </code>
8239  Remarks:
8240  This function implements an operation of the ChannelXPriority feature.
8241  This feature may not be available on all devices. Please refer to the
8242  specific device data sheet to determine availability or use the
8243  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8244  whether this feature is available.
8245 */
8246 
8247 void
8249  DMA_MODULE_ID index ,
8250  DMA_CHANNEL channel ,
8251  DMA_CHANNEL_PRIORITY channelPriority ) ;
8252 //******************************************************************************
8253 /* Function:
8254  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet ( DMA_MODULE_ID index,
8255  DMA_CHANNEL channel )
8256  Summary:
8257  Gets the priority of the specified channel.
8258  Description:
8259  This function gets the priority of the specified channel.
8260  Precondition:
8261  None.
8262  Parameters:
8263  channel - One of the existing DMA channels listed by DMA_CHANNEL
8264  Returns:
8265  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8266  Example:
8267  <code>
8268  DMA_CHANNEL channel = DMA_CHANNEL_0;
8269  DMA_CHANNEL_PRIORITY channelPriority;
8270  channelPriority = PLIB_DMA_ChannelXPriorityGet( DMA_ID_0, channel );
8271  </code>
8272  Remarks:
8273  This function implements an operation of the ChannelXPriority feature.
8274  This feature may not be available on all devices. Please refer to the
8275  specific device data sheet to determine availability or use the
8276  PLIB_DMA_ExistsChannelXPriority function in your application to determine
8277  whether this feature is available.
8278 */
8279 
8280 DMA_CHANNEL_PRIORITY
8282  DMA_MODULE_ID index ,
8283  DMA_CHANNEL channel ) ;
8284 //******************************************************************************
8285 /* Function:
8286  void PLIB_DMA_ChannelPrioritySelect ( DMA_MODULE_ID index,
8287  DMA_CHANNEL_PRIORITY channelPriority )
8288  Summary:
8289  Sets the priority scheme of the DMA channels.
8290  Description:
8291  This function sets the priority scheme of the DMA channels at the global level.
8292  This function is used in devices that do not have the per channel priority feature.
8293  Precondition:
8294  None.
8295  Parameters:
8296  channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8297  Returns:
8298  None.
8299  Example:
8300  <code>
8301  DMA_CHANNEL_PRIORITY channelPriority = DMA_CHANNEL_ROUND_ROBIN;
8302  PLIB_DMA_ChannelPrioritySelect( DMA_ID_0, channelPriority );
8303  </code>
8304  Remarks:
8305  This feature is not available on all devices. Please refer to the specific
8306  device data sheet to determine availability.
8307 */
8308 
8309 void
8311  DMA_MODULE_ID index ,
8312  DMA_CHANNEL_PRIORITY channelPriority ) ;
8313 //******************************************************************************
8314 /* Function:
8315  DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet ( DMA_MODULE_ID index )
8316  Summary:
8317  Gets the priority scheme of the DMA channels.
8318  Description:
8319  This function gets the priority scheme of the DMA channels at the global level.
8320  This function is used in devices that do not have the per channel priority feature.
8321  Precondition:
8322  None.
8323  Parameters:
8324  None.
8325  Returns:
8326  - channelPriority - One of the supported priorities listed by DMA_CHANNEL_PRIORITY
8327  Example:
8328  <code>
8329  DMA_CHANNEL_PRIORITY channelPriority;
8330  channelPriority = PLIB_DMA_ChannelPriorityGet( DMA_ID_0 );
8331  </code>
8332  Remarks:
8333  This feature is not available on all devices. Please refer to the specific
8334  device data sheet to determine availability.
8335 */
8336 
8337 DMA_CHANNEL_PRIORITY
8339  DMA_MODULE_ID index ) ;
8340 //******************************************************************************
8341 /* Function:
8342  void PLIB_DMA_ChannelXAutoEnable ( DMA_MODULE_ID index,
8343  DMA_CHANNEL channel )
8344  Summary:
8345  Channel is continuously enabled.
8346  Description:
8347  This function enables the channel continuously. The channel is not automatically
8348  disabled after a block transfer is complete.
8349  Precondition:
8350  None.
8351  Parameters:
8352  channel - One of the possible DMA channels listed by DMA_CHANNEL
8353  Returns:
8354  None.
8355  Example:
8356  <code>
8357  PLIB_DMA_ChannelXAutoEnable( DMA_ID_0, DMA_CHANNEL_2 );
8358  </code>
8359  Remarks:
8360  This function implements an operation of the ChannelXAuto feature.
8361  This feature may not be available on all devices. Please refer to the
8362  specific device data sheet to determine availability or use the
8363  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8364  whether this feature is available.
8365 */
8366 
8367 void
8369  DMA_MODULE_ID index ,
8370  DMA_CHANNEL channel ) ;
8371 //******************************************************************************
8372 /* Function:
8373  bool PLIB_DMA_ChannelXAutoIsEnabled ( DMA_MODULE_ID index,
8374  DMA_CHANNEL channel )
8375  Summary:
8376  Returns the channel automatic enable status.
8377  Description:
8378  This function returns the channel automatic enable status.
8379  Precondition:
8380  None.
8381  Parameters:
8382  channel - One of the possible DMA channels listed by DMA_CHANNEL
8383  Returns:
8384  - true - Channel automatic enable is on
8385  - false - Channel automatic enable is off
8386  Example:
8387  <code>
8388  bool ChAutoEnableStatus;
8389  ChAutoEnableStatus = PLIB_DMA_ChannelXAutoIsEnabled(DMA_ID_0, DMA_CHANNEL_2 );
8390  </code>
8391  Remarks:
8392  This function implements an operation of the ChannelXAuto feature.
8393  This feature may not be available on all devices. Please refer to the
8394  specific device data sheet to determine availability or use the
8395  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8396  whether this feature is available.
8397 */
8398 
8399 bool
8401  DMA_MODULE_ID index ,
8402  DMA_CHANNEL channel ) ;
8403 //******************************************************************************
8404 /* Function:
8405  void PLIB_DMA_ChannelXAutoDisable ( DMA_MODULE_ID index,
8406  DMA_CHANNEL channel )
8407  Summary:
8408  Channel is disabled after a block transfer is complete.
8409  Description:
8410  This function disables a channel after a block transfer is complete.
8411  Precondition:
8412  None.
8413  Parameters:
8414  channel - One of the possible DMA channels listed by DMA_CHANNEL
8415  Returns:
8416  None.
8417  Example:
8418  <code>
8419  PLIB_DMA_ChannelXAutoDisable( DMA_ID_0, DMA_CHANNEL_2 );
8420  </code>
8421  Remarks:
8422  This function implements an operation of the ChannelXAuto feature.
8423  This feature may not be available on all devices. Please refer to the
8424  specific device data sheet to determine availability or use the
8425  PLIB_DMA_ExistsChannelXAuto function in your application to determine
8426  whether this feature is available.
8427 */
8428 
8429 void
8431  DMA_MODULE_ID index ,
8432  DMA_CHANNEL channel ) ;
8433 //******************************************************************************
8434 /* Function:
8435  void PLIB_DMA_ChannelXChainEnable ( DMA_MODULE_ID index,
8436  DMA_CHANNEL channel )
8437  Summary:
8438  Channel chain feature is enabled.
8439  Description:
8440  This function enables the channel chain feature.
8441  Precondition:
8442  None.
8443  Parameters:
8444  channel - One of the possible DMA channels listed by DMA_CHANNEL
8445  Returns:
8446  None.
8447  Example:
8448  <code>
8449  PLIB_DMA_ChannelXChainEnable( DMA_ID_0, DMA_CHANNEL_2 );
8450  </code>
8451  Remarks:
8452  This function implements an operation of the ChannelXChainEnbl feature.
8453  This feature may not be available on all devices. Please refer to the
8454  specific device data sheet to determine availability or use the
8455  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8456  whether this feature is available.
8457 */
8458 
8459 void
8461  DMA_MODULE_ID index ,
8462  DMA_CHANNEL channel ) ;
8463 //******************************************************************************
8464 /* Function:
8465  bool PLIB_DMA_ChannelXChainIsEnabled ( DMA_MODULE_ID index,
8466  DMA_CHANNEL channel )
8467  Summary:
8468  Returns the chain status of the specified channel.
8469  Description:
8470  This function returns the chain status of the specified channel.
8471  Precondition:
8472  None.
8473  Parameters:
8474  channel - One of the possible DMA channels listed by DMA_CHANNEL
8475  Returns:
8476  - true - The channel chain is on for this channel
8477  - false - The channel chain is off for this channel
8478  Example:
8479  <code>
8480  bool ChchainStatus;
8481  ChchainStatus = PLIB_DMA_ChannelXChainIsEnabled( DMA_ID_0, DMA_CHANNEL_2 );
8482  </code>
8483  Remarks:
8484  This function implements an operation of the ChannelXChainEnbl feature.
8485  This feature may not be available on all devices. Please refer to the
8486  specific device data sheet to determine availability or use the
8487  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8488  whether this feature is available.
8489 */
8490 
8491 bool
8493  DMA_MODULE_ID index ,
8494  DMA_CHANNEL channel ) ;
8495 //******************************************************************************
8496 /* Function:
8497  void PLIB_DMA_ChannelXChainDisable( DMA_MODULE_ID index,
8498  DMA_CHANNEL channel )
8499  Summary:
8500  Disables the channel chaining for the specified DMA channel.
8501  Description:
8502  This function disables the channel chaining for the specified DMA channel.
8503  Precondition:
8504  None.
8505  Parameters:
8506  channel - One of the possible DMA channels listed by DMA_CHANNEL
8507  Returns:
8508  None.
8509  Example:
8510  <code>
8511  PLIB_DMA_ChannelXChainDisable( DMA_ID_0, DMA_CHANNEL_2 );
8512  </code>
8513  Remarks:
8514  This function implements an operation of the ChannelXChainEnbl feature.
8515  This feature may not be available on all devices. Please refer to the
8516  specific device data sheet to determine availability or use the
8517  PLIB_DMA_ExistsChannelXChainEnbl function in your application to determine
8518  whether this feature is available.
8519 */
8520 
8521 void
8523  DMA_MODULE_ID index ,
8524  DMA_CHANNEL channel ) ;
8525 //******************************************************************************
8526 /* Function:
8527  void PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_MODULE_ID index,
8528  DMA_CHANNEL channel )
8529  Summary:
8530  Channel start/abort events will be registered even if the channel is
8531  disabled.
8532  Description:
8533  This function will allow the channel register start/abort events even if the
8534  channel is disabled.
8535  Precondition:
8536  None.
8537  Parameters:
8538  channel - One of the possible DMA channels listed by DMA_CHANNEL
8539  Returns:
8540  None.
8541  Example:
8542  <code>
8543  PLIB_DMA_ChannelXDisabledEnablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8544  </code>
8545  Remarks:
8546  This function implements an operation of the ChannelXDisabled feature.
8547  This feature may not be available on all devices. Please refer to the
8548  specific device data sheet to determine availability or use the
8549  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8550  determine whether this feature is available.
8551 */
8552 
8553 void
8555  DMA_MODULE_ID index ,
8556  DMA_CHANNEL channel ) ;
8557 //******************************************************************************
8558 /* Function:
8559  void PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_MODULE_ID index,
8560  DMA_CHANNEL channel )
8561  Summary:
8562  Channel start/abort events will be ignored even if the channel is
8563  disabled.
8564  Description:
8565  This function will allow the channel start/abort events to be ignored even if
8566  the channel is disabled.
8567  Precondition:
8568  None.
8569  Parameters:
8570  channel - One of the possible DMA channels listed by DMA_CHANNEL
8571  Returns:
8572  None.
8573  Example:
8574  <code>
8575  PLIB_DMA_ChannelXDisabledDisablesEvents ( DMA_ID_0, DMA_CHANNEL_2 );
8576  </code>
8577  Remarks:
8578  This function implements an operation of the ChannelXDisabled feature.
8579  This feature may not be available on all devices. Please refer to the
8580  specific device data sheet to determine availability or use the
8581  PLIB_DMA_ExistsChannelXDisabled function in your application to automatically
8582  determine whether this feature is available.
8583 */
8584 
8585 void
8587  DMA_MODULE_ID index ,
8588  DMA_CHANNEL channel ) ;
8589 //******************************************************************************
8590 /* Function:
8591  void PLIB_DMA_ChannelXEnable ( DMA_MODULE_ID index,
8592  DMA_CHANNEL channel )
8593  Summary:
8594  Enable the specified channel.
8595  Description:
8596  This function will enable the specified channel.
8597  Precondition:
8598  None.
8599  Parameters:
8600  channel - One of the possible DMA channels listed by DMA_CHANNEL
8601  Returns:
8602  None.
8603  Example:
8604  <code>
8605  PLIB_DMA_ChannelXEnable ( DMA_ID_0, DMA_CHANNEL_2 );
8606  </code>
8607  Remarks:
8608  This function implements an operation of the ChannelX feature.
8609  This feature may not be available on all devices. Please refer to the
8610  specific device data sheet to determine availability or use the
8611  PLIB_DMA_ExistsChannelX function in your application to automatically
8612  determine whether this feature is available.
8613 */
8614 
8615 void
8617  DMA_MODULE_ID index ,
8618  DMA_CHANNEL channel ) ;
8619 //******************************************************************************
8620 /* Function:
8621  bool PLIB_DMA_ChannelXIsEnabled ( DMA_MODULE_ID index,
8622  DMA_CHANNEL channel )
8623  Summary:
8624  Return the enable status of the specified channel.
8625  Description:
8626  This function will return the enable status of the specified channel.
8627  Precondition:
8628  None.
8629  Parameters:
8630  channel - One of the possible DMA channels listed by DMA_CHANNEL
8631  Returns:
8632  - true - The specified DMA channel is enabled
8633  - false - The specified DMA channel is disabled
8634  Example:
8635  <code>
8636  bool chEnableStatus;
8637  chEnableStatus = PLIB_DMA_ChannelXIsEnabled ( DMA_ID_0, DMA_CHANNEL_2 );
8638  </code>
8639  Remarks:
8640  This function implements an operation of the ChannelX feature.
8641  This feature may not be available on all devices. Please refer to the
8642  specific device data sheet to determine availability or use the
8643  PLIB_DMA_ExistsChannelX function in your application to automatically
8644  determine whether this feature is available.
8645 */
8646 
8647 bool
8649  DMA_MODULE_ID index ,
8650  DMA_CHANNEL channel ) ;
8651 //******************************************************************************
8652 /* Function:
8653  void PLIB_DMA_ChannelXDisable ( DMA_MODULE_ID index,
8654  DMA_CHANNEL channel )
8655  Summary:
8656  Disable the specified channel.
8657  Description:
8658  This function will disable the specified channel.
8659  Precondition:
8660  None.
8661  Parameters:
8662  channel - One of the possible DMA channels listed by DMA_CHANNEL
8663  Returns:
8664  None.
8665  Example:
8666  <code>
8667  PLIB_DMA_ChannelXDisable ( DMA_ID_0, DMA_CHANNEL_2 );
8668  </code>
8669  Remarks:
8670  This function implements an operation of the ChannelX feature.
8671  This feature may not be available on all devices. Please refer to the
8672  specific device data sheet to determine availability or use the
8673  PLIB_DMA_ExistsChannelX function in your application to automatically
8674  determine whether this feature is available.
8675 */
8676 
8677 void
8679  DMA_MODULE_ID index ,
8680  DMA_CHANNEL channel ) ;
8681 //******************************************************************************
8682 /* Function:
8683  void PLIB_DMA_ChannelXChainToLower( DMA_MODULE_ID index,
8684  DMA_CHANNEL channel )
8685  Summary:
8686  Chains the specified channel to a channel lower in natural priority.
8687  Description:
8688  This function will chain the specified channel to a channel lower in
8689  natural priority. CH3 will be enabled by a CH4 transfer complete.
8690  Precondition:
8691  None.
8692  Parameters:
8693  channel - One of the possible DMA channels listed by DMA_CHANNEL
8694  Returns:
8695  None.
8696  Example:
8697  <code>
8698  PLIB_DMA_ChannelXChainToLower ( DMA_ID_0, DMA_CHANNEL_4 );
8699  </code>
8700  Remarks:
8701  This function implements an operation of the ChannelXChain feature.
8702  This feature may not be available on all devices. Please refer to the
8703  specific device data sheet to determine availability or use the
8704  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8705  determine whether this feature is available.
8706 */
8707 
8708 void
8710  DMA_MODULE_ID index ,
8711  DMA_CHANNEL channel ) ;
8712 //******************************************************************************
8713 /* Function:
8714  void PLIB_DMA_ChannelXChainToHigher ( DMA_MODULE_ID index,
8715  DMA_CHANNEL channel )
8716  Summary:
8717  Chains the specified channel to a channel higher in natural priority.
8718  Description:
8719  This function will chain the specified channel to a channel higher in
8720  natural priority. CH5 will be enabled by a CH4 transfer complete.
8721  Precondition:
8722  None.
8723  Parameters:
8724  channel - One of the possible DMA channels listed by DMA_CHANNEL
8725  Returns:
8726  None.
8727  Example:
8728  <code>
8729  PLIB_DMA_ChannelXChainToHigher ( DMA_ID_0, DMA_CHANNEL_4 );
8730  </code>
8731  Remarks:
8732  This function implements an operation of the ChannelXChain feature.
8733  This feature may not be available on all devices. Please refer to the
8734  specific device data sheet to determine availability or use the
8735  PLIB_DMA_ExistsChannelXChain function in your application to automatically
8736  determine whether this feature is available.
8737 */
8738 
8739 void
8741  DMA_MODULE_ID index ,
8742  DMA_CHANNEL channel ) ;
8743 //******************************************************************************
8744 /* Function:
8745  void PLIB_DMA_ChannelXBusyActiveSet ( DMA_MODULE_ID index,
8746  DMA_CHANNEL channel )
8747  Summary:
8748  Sets the Busy bit to active.
8749  Description:
8750  This function sets the Busy bit to active, indicating the channel is active
8751  or has been enabled.
8752  Precondition:
8753  None.
8754  Parameters:
8755  channel - One of the possible DMA channels listed by DMA_CHANNEL
8756  Returns:
8757  None.
8758  Example:
8759  <code>
8760  PLIB_DMA_ChannelXBusyActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8761  </code>
8762  Remarks:
8763  This function implements an operation of the ChannelXBusy feature.
8764  This feature may not be available on all devices. Please refer to the
8765  specific device data sheet to determine availability or use the
8766  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8767  determine whether this feature is available.
8768 */
8769 
8770 void
8772  DMA_MODULE_ID index ,
8773  DMA_CHANNEL channel ) ;
8774 //******************************************************************************
8775 /* Function:
8776  void PLIB_DMA_ChannelXBusyInActiveSet ( DMA_MODULE_ID index,
8777  DMA_CHANNEL channel )
8778  Summary:
8779  Sets the Busy bit to inactive.
8780  Description:
8781  This function sets the Busy bit to inactive, indicating the channel is inactive
8782  or has been disabled.
8783  Precondition:
8784  None.
8785  Parameters:
8786  channel - One of the possible DMA channels listed by DMA_CHANNEL
8787  Returns:
8788  None.
8789  Example:
8790  <code>
8791  PLIB_DMA_ChannelXBusyInActiveSet ( DMA_ID_0, DMA_CHANNEL_4 );
8792  </code>
8793  Remarks:
8794  This function implements an operation of the ChannelXBusy feature.
8795  This feature may not be available on all devices. Please refer to the
8796  specific device data sheet to determine availability or use the
8797  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8798  determine whether this feature is available.
8799 */
8800 
8801 void
8803  DMA_MODULE_ID index ,
8804  DMA_CHANNEL channel ) ;
8805 //******************************************************************************
8806 /* Function:
8807  bool PLIB_DMA_ChannelXBusyIsBusy ( DMA_MODULE_ID index,
8808  DMA_CHANNEL channel )
8809  Summary:
8810  Returns the busy status of the specified channel.
8811  Description:
8812  This function returns the busy status of the specified channel.
8813  Precondition:
8814  None.
8815  Parameters:
8816  channel - One of the possible DMA channels listed by DMA_CHANNEL
8817  Returns:
8818  - true - The channel is active or has been enabled
8819  - false - The channel is inactive or has been disabled
8820  Example:
8821  <code>
8822  bool chBusyStatus;
8823  chBusyStatus = PLIB_DMA_ChannelXBusyIsBusy ( DMA_ID_0, DMA_CHANNEL_4 );
8824  </code>
8825  Remarks:
8826  This function implements an operation of the ChannelXBusy feature.
8827  This feature may not be available on all devices. Please refer to the
8828  specific device data sheet to determine availability or use the
8829  PLIB_DMA_ExistsChannelXBusy function in your application to automatically
8830  determine whether this feature is available.
8831 */
8832 
8833 bool
8835  DMA_MODULE_ID index ,
8836  DMA_CHANNEL channel ) ;
8837 //******************************************************************************
8838 /* Function:
8839  void PLIB_DMA_ChannelXTransferDirectionSelect ( DMA_MODULE_ID index,
8840  DMA_CHANNEL channel,
8841  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection )
8842  Summary:
8843  Selects the data transfer direction of the specified channel.
8844  Description:
8845  This function selects the data transfer direction of the specified channel.
8846  Precondition:
8847  None.
8848  Parameters:
8849  channel - One of the possible DMA channels listed by DMA_CHANNEL
8850  chTransferDirection - The transfer direction indicated by DMA_CHANNEL_TRANSFER_DIRECTION
8851  Returns:
8852  None.
8853  Example:
8854  <code>
8855  PLIB_DMA_ChannelXTransferDirectionSelect (
8856  DMA_ID_0,
8857  DMA_CHANNEL_4,
8858  DMA_READ_FROM_MEMORY_WRITE_TO_PERIPHERAL );
8859  </code>
8860  Remarks:
8861  This feature is not available on all devices. Please refer to the specific
8862  device data sheet to determine availability.
8863 */
8864 
8865 void
8867  DMA_MODULE_ID index ,
8868  DMA_CHANNEL channel ,
8869  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection ) ;
8870 //******************************************************************************
8871 /* Function:
8872  DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet (
8873  DMA_MODULE_ID index,
8874  DMA_CHANNEL channel)
8875  Summary:
8876  Returns the data transfer direction of the specified channel.
8877  Description:
8878  This function returns the data transfer direction of the specified channel.
8879  Precondition:
8880  None.
8881  Parameters:
8882  channel - One of the possible DMA channels listed by DMA_CHANNEL
8883  Returns:
8884  - DMA_CHANNEL_TRANSFER_DIRECTION - The transfer direction indicated by the
8885  DMA_CHANNEL_TRANSFER_DIRECTION
8886  Example:
8887  <code>
8888  DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection;
8889  chTransferDirection = PLIB_DMA_ChannelXTransferDirectionGet (
8890  DMA_ID_0,
8891  DMA_CHANNEL_4 );
8892  </code>
8893  Remarks:
8894  This feature is not available on all devices. Please refer to the specific
8895  device data sheet to determine availability.
8896 */
8897 
8898 DMA_CHANNEL_TRANSFER_DIRECTION
8900  DMA_MODULE_ID index ,
8901  DMA_CHANNEL channel ) ;
8902 //******************************************************************************
8903 /* Function:
8904  void PLIB_DMA_ChannelXStartAddressOffsetSet( DMA_MODULE_ID index,
8905  DMA_CHANNEL channel ,
8906  uint16_t address,
8907  DMA_ADDRESS_OFFSET_TYPE offset )
8908  Summary:
8909  Sets the primary/secondary start address (DPSRAM) offset to the value
8910  specified depending on the offset type specified for the specified channel.
8911  Description:
8912  This function sets the primary/secondary start address (DPSRAM) offset to the value
8913  specified depending on the offset type specified for the specified channel.
8914  Precondition:
8915  None.
8916  Parameters:
8917  channel - One of the possible DMA channels listed by DMA_CHANNEL
8918  address - The primary/secondary DPSRAM start address offset
8919  offset - The type of the address offset (primary/secondary)
8920  Returns:
8921  None.
8922  Example:
8923  <code>
8924  uint16_t address = 0x100;
8925  PLIB_DMA_ChannelXStartAddressOffsetSet ( DMA_ID_0,
8926  DMA_CHANNEL_4,
8927  address,
8928  DMA_ADDRESS_OFFSET_PRIMARY );
8929  </code>
8930  Remarks:
8931  This feature is not available on all devices. Please refer to the specific
8932  device data sheet to determine availability.
8933 */
8934 
8935 void
8937  DMA_MODULE_ID index ,
8938  DMA_CHANNEL channel ,
8939  uint16_t address ,
8940  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8941 //******************************************************************************
8942 /* Function:
8943  uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet ( DMA_MODULE_ID index,
8944  DMA_CHANNEL channel,
8945  DMA_ADDRESS_OFFSET_TYPE offset)
8946  Summary:
8947  Gets the primary/secondary start address (DPSRAM) offset.
8948  Description:
8949  This function gets the primary/secondary start address (DPSRAM) offset.
8950  Precondition:
8951  None.
8952  Parameters:
8953  channel - One of the possible DMA channels listed by DMA_CHANNEL
8954  offset - The type of the address offset (primary/secondary)
8955  Returns:
8956  - uint16_t - The primary/secondary DPSRAM start address offset
8957  Example:
8958  <code>
8959  uint16_t addressOffsetA;
8960  addressOffsetA = PLIB_DMA_ChannelXStartAddressOffsetGet (
8961  DMA_ID_0,
8962  DMA_CHANNEL_4,
8963  address,
8964  DMA_ADDRESS_OFFSET_PRIMARY );
8965  </code>
8966  Remarks:
8967  This feature is not available on all devices. Please refer to the specific
8968  device data sheet to determine availability.
8969 */
8970 
8971 uint16_t
8973  DMA_MODULE_ID index ,
8974  DMA_CHANNEL channel ,
8975  DMA_ADDRESS_OFFSET_TYPE offset ) ;
8976 //******************************************************************************
8977 /* Function:
8978  void PLIB_DMA_ChannelXPeripheralAddressSet( DMA_MODULE_ID index,
8979  DMA_CHANNEL channel ,
8980  uint16_t peripheraladdress )
8981  Summary:
8982  Sets the peripheral address for the specified channel.
8983  Description:
8984  This function sets the peripheral address for the specified channel.
8985  Precondition:
8986  None.
8987  Parameters:
8988  channel - One of the possible DMA channels listed by DMA_CHANNEL
8989  peripheraladdress - The peripheral address for the specified channel
8990  Returns:
8991  None.
8992  Example:
8993  <code>
8994  uint16_t peripheraladdress = 0x100;
8995  PLIB_DMA_ChannelXPeripheralAddressSet ( DMA_ID_0,
8996  DMA_CHANNEL_4,
8997  peripheraladdress );
8998  </code>
8999  Remarks:
9000  This feature is not available on all devices. Please refer to the specific
9001  device data sheet to determine availability.
9002 */
9003 
9004 void
9006  DMA_MODULE_ID index ,
9007  DMA_CHANNEL channel ,
9008  uint16_t peripheraladdress ) ;
9009 //******************************************************************************
9010 /* Function:
9011  uint16_t PLIB_DMA_ChannelXPeripheralAddressGet( DMA_MODULE_ID index,
9012  DMA_CHANNEL channel )
9013  Summary:
9014  Gets the peripheral address configured for the specified channel.
9015  Description:
9016  This function gets the peripheral address configured for the specified channel.
9017  Precondition:
9018  None.
9019  Parameters:
9020  channel - One of the possible DMA channels listed by DMA_CHANNEL
9021  Returns:
9022  - uint16_t - The peripheral address configured for the specified channel
9023  Example:
9024  <code>
9025  uint16_t peripheraladdress;
9026  peripheraladdress = PLIB_DMA_ChannelXPeripheralAddressGet ( DMA_ID_0,
9027  DMA_CHANNEL_4 );
9028  </code>
9029  Remarks:
9030  This feature is not available on all devices. Please refer to the specific
9031  device data sheet to determine availability.
9032 */
9033 
9034 uint16_t
9036  DMA_MODULE_ID index ,
9037  DMA_CHANNEL channel ) ;
9038 //******************************************************************************
9039 /* Function:
9040  void PLIB_DMA_ChannelXTransferCountSet( DMA_MODULE_ID index,
9041  DMA_CHANNEL channel ,
9042  uint16_t transferCount )
9043  Summary:
9044  Sets the DMA data transfer count for the specified channel.
9045  Description:
9046  This function sets the DMA data transfer count for the specified channel.
9047  Precondition:
9048  None.
9049  Parameters:
9050  channel - One of the possible DMA channels listed by DMA_CHANNEL
9051  transferCount - The DMA transfer count for the channel
9052  Returns:
9053  None.
9054  Example:
9055  <code>
9056  uint16_t transferCount = 0x10;
9057  PLIB_DMA_ChannelXTransferCountSet ( DMA_ID_0,
9058  DMA_CHANNEL_4,
9059  transferCount );
9060  </code>
9061  Remarks:
9062  This feature is not available on all devices. Please refer to the specific
9063  device data sheet to determine availability.
9064 */
9065 
9066 void
9068  DMA_MODULE_ID index ,
9069  DMA_CHANNEL channel ,
9070  uint16_t transferCount ) ;
9071 //******************************************************************************
9072 /* Function:
9073  uint16_t PLIB_DMA_ChannelXTransferCountGet( DMA_MODULE_ID index,
9074  DMA_CHANNEL channel )
9075  Summary:
9076  Gets the DMA data transfer count that is programmed for the specified channel.
9077  Description:
9078  This function gets the DMA data transfer count that is programmed for the specified channel.
9079  Precondition:
9080  None.
9081  Parameters:
9082  channel - One of the possible DMA channels listed by DMA_CHANNEL
9083  Returns:
9084  - uint16_t - The DMA transfer count for the channel
9085  Example:
9086  <code>
9087  uint16_t transferCount;
9088  transferCount = PLIB_DMA_ChannelXTransferCountGet ( DMA_ID_0,
9089  DMA_CHANNEL_4 );
9090  </code>
9091  Remarks:
9092  This feature is not available on all devices. Please refer to the specific
9093  device data sheet to determine availability.
9094 */
9095 
9096 uint16_t
9098  DMA_MODULE_ID index ,
9099  DMA_CHANNEL channel ) ;
9100 //******************************************************************************
9101 /* Function:
9102  void PLIB_DMA_ChannelXSourceAddressModeSelect (
9103  DMA_MODULE_ID index,
9104  DMA_CHANNEL channel,
9105  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode )
9106  Summary:
9107  Sets the source address mode of the specified channel.
9108  Description:
9109  This function sets the source address mode of the specified channel.
9110  Precondition:
9111  None.
9112  Parameters:
9113  channel - One of the possible DMA channels listed by DMA_CHANNEL
9114  sourceAddressMode - One of the possible source addressing modes listed by
9115  DMA_SOURCE_ADDRESSING_MODE
9116  Returns:
9117  None.
9118  Example:
9119  <code>
9120  PLIB_DMA_ChannelXSourceAddressModeSelect (
9121  DMA_ID_0,
9122  DMA_CHANNEL_4,
9123  DMA_ADDRESSING_SOURCE_INCREMENT_BASED_ON_SIZE );
9124  </code>
9125  Remarks:
9126  This feature is not available on all devices. Please refer to the specific
9127  device data sheet to determine availability.
9128 */
9129 
9130 void
9132  DMA_MODULE_ID index ,
9133  DMA_CHANNEL channel ,
9134  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode ) ;
9135 //******************************************************************************
9136 /* Function:
9137  DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet (
9138  DMA_MODULE_ID index,
9139  DMA_CHANNEL channel )
9140  Summary:
9141  Gets the source address mode of the specified channel.
9142  Description:
9143  This function gets the source address mode of the specified channel.
9144  Precondition:
9145  None.
9146  Parameters:
9147  channel - One of the possible DMA channels listed by DMA_CHANNEL
9148  Returns:
9149  - DMA_SOURCE_ADDRESSING_MODE - One of the possible source addressing modes
9150  listed by DMA_SOURCE_ADDRESSING_MODE
9151  Example:
9152  <code>
9153  DMA_SOURCE_ADDRESSING_MODE sourceAddressMode;
9154  sourceAddressMode = PLIB_DMA_ChannelXSourceAddressModeGet ( DMA_ID_0,
9155  DMA_CHANNEL_4 );
9156  </code>
9157  Remarks:
9158  This feature is not available on all devices. Please refer to the specific
9159  device data sheet to determine availability.
9160 */
9161 
9162 DMA_SOURCE_ADDRESSING_MODE
9164  DMA_MODULE_ID index ,
9165  DMA_CHANNEL channel ) ;
9166 //******************************************************************************
9167 /* Function:
9168  void PLIB_DMA_ChannelXDestinationAddressModeSelect (
9169  DMA_MODULE_ID index,
9170  DMA_CHANNEL channel,
9171  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode )
9172  Summary:
9173  Sets the source address mode of the specified channel.
9174  Description:
9175  This function Sets the source address mode of the specified channel.
9176  Precondition:
9177  None.
9178  Parameters:
9179  channel - One of the possible DMA channels listed by DMA_CHANNEL
9180  destinationAddressMode - One of the possible source addressing modes listed by
9181  DMA_DESTINATION_ADDRESSING_MODE
9182  Returns:
9183  None.
9184  Example:
9185  <code>
9186  PLIB_DMA_ChannelXDestinationAddressModeSelect (
9187  DMA_ID_0,
9188  DMA_CHANNEL_4,
9189  DMA_ADDRESSING_DESTINATION_INCREMENT_BASED_ON_SIZE );
9190  </code>
9191  Remarks:
9192  This feature is not available on all devices. Please refer to the specific
9193  device data sheet to determine availability.
9194 */
9195 
9196 void
9198  DMA_MODULE_ID index ,
9199  DMA_CHANNEL channel ,
9200  DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode ) ;
9201 //******************************************************************************
9202 /* Function:
9203  DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet (
9204  DMA_MODULE_ID index,
9205  DMA_CHANNEL channel )
9206  Summary:
9207  Gets the source address mode of the specified channel.
9208  Description:
9209  This function gets the source address mode of the specified channel.
9210  Precondition:
9211  None.
9212  Parameters:
9213  channel - One of the possible DMA channels listed by DMA_CHANNEL
9214  Returns:
9215  - destinationAddressMode - One of the possible source addressing modes listed by
9216  DMA_DESTINATION_ADDRESSING_MODE
9217  Example:
9218  <code>
9219  DMA_SOURCE_ADDRESSING_MODE destinationAddressMode;
9220  destinationAddressMode = PLIB_DMA_ChannelXDestinationAddressModeGet (
9221  DMA_ID_0,
9222  DMA_CHANNEL_4 );
9223  </code>
9224  Remarks:
9225  This feature is not available on all devices. Please refer to the specific
9226  device data sheet to determine availability.
9227 */
9228 
9229 DMA_DESTINATION_ADDRESSING_MODE
9231  DMA_MODULE_ID index ,
9232  DMA_CHANNEL channel ) ;
9233 //******************************************************************************
9234 /* Function:
9235  void PLIB_DMA_ChannelXAddressModeSelect (
9236  DMA_MODULE_ID index,
9237  DMA_CHANNEL channel,
9238  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode )
9239  Summary:
9240  Sets the channel address mode.
9241  Description:
9242  This function sets the channel address mode.
9243  Precondition:
9244  None.
9245  Parameters:
9246  channel - One of the possible DMA channels listed by DMA_CHANNEL
9247  channelAddressMode - One of the possible channel addressing modes listed by
9248  DMA_CHANNEL_ADDRESSING_MODE
9249  Returns:
9250  None.
9251  Example:
9252  <code>
9253  PLIB_DMA_ChannelXAddressModeSelect (
9254  DMA_ID_0,
9255  DMA_CHANNEL_4,
9256  DMA_ADDRESSING_REGISTER_INDIRECT_WITH_POST_INCREMENT );
9257  </code>
9258  Remarks:
9259  This feature is not available on all devices. Please refer to the specific
9260  device data sheet to determine availability.
9261 */
9262 
9263 void
9265  DMA_MODULE_ID index ,
9266  DMA_CHANNEL channel ,
9267  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode ) ;
9268 //******************************************************************************
9269 /* Function:
9270  DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet (
9271  DMA_MODULE_ID index,
9272  DMA_CHANNEL channel )
9273  Summary:
9274  Gets the channel address mode.
9275  Description:
9276  This function gets the channel address mode.
9277  Precondition:
9278  None.
9279  Parameters:
9280  channel - One of the possible DMA channels listed by DMA_CHANNEL
9281  Returns:
9282  - channelAddressMode - One of the possible source addressing modes listed by
9283  DMA_CHANNEL_ADDRESSING_MODE
9284  Example:
9285  <code>
9286  DMA_CHANNEL_ADDRESSING_MODE channelAddressMode;
9287  channelAddressMode = PLIB_DMA_ChannelXAddressModeGet ( DMA_ID_0,
9288  DMA_CHANNEL_4 );
9289  </code>
9290  Remarks:
9291  This feature is not available on all devices. Please refer to the specific
9292  device data sheet to determine availability.
9293 */
9294 
9295 DMA_CHANNEL_ADDRESSING_MODE
9297  DMA_MODULE_ID index ,
9298  DMA_CHANNEL channel ) ;
9299 // *****************************************************************************
9300 // *****************************************************************************
9301 // Section: DMA Channel Event Configuration functions
9302 // *****************************************************************************
9303 // *****************************************************************************
9304 //******************************************************************************
9305 /* Function:
9306  void PLIB_DMA_ChannelXTriggerEnable ( DMA_MODULE_ID index,
9307  DMA_CHANNEL channel,
9308  DMA_CHANNEL_TRIGGER_TYPE trigger )
9309  Summary:
9310  Enables the specified DMA channel trigger.
9311  Description:
9312  This function enables the specified DMA channel trigger.
9313  Precondition:
9314  None.
9315  Parameters:
9316  channel - One of the possible DMA channels listed by DMA_CHANNEL
9317  trigger - Type of trigger (transfer start/abort/pattern match abort)
9318  Returns:
9319  None.
9320  Example:
9321  <code>
9322  PLIB_DMA_ChannelXTriggerEnable ( DMA_ID_0,
9323  DMA_CHANNEL_4,
9324  DMA_CHANNEL_TRIGGER_TRANSFER_ABORT );
9325  </code>
9326  Remarks:
9327  This function implements an operation of the ChannelXTrigger feature.
9328  This feature may not be available on all devices. Please refer to the
9329  specific device data sheet to determine availability or use the
9330  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9331  determine whether this feature is available.
9332 */
9333 
9334 void
9336  DMA_MODULE_ID index ,
9337  DMA_CHANNEL channel ,
9338  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9339 //******************************************************************************
9340 /* Function:
9341  bool PLIB_DMA_ChannelXTriggerIsEnabled( DMA_MODULE_ID index,
9342  DMA_CHANNEL channel,
9343  DMA_CHANNEL_TRIGGER_TYPE trigger )
9344  Summary:
9345  Returns the enable status of the specified DMA transfer/abort trigger.
9346  Description:
9347  This function returns the enable status of the specified DMA transfer/abort trigger.
9348  Precondition:
9349  None.
9350  Parameters:
9351  channel - One of the possible DMA channels listed by DMA_CHANNEL
9352  trigger - Type of trigger (transfer start/abort/pattern match abort)
9353  Returns:
9354  - true - The specified trigger is enabled
9355  - false - The specified trigger is disabled
9356  Example:
9357  <code>
9358  bool startTriggerstatus;
9359  startTriggerstatus = PLIB_DMA_ChannelXTriggerIsEnabled (
9360  DMA_ID_0,
9361  DMA_CHANNEL_4,
9362  DMA_CHANNEL_TRIGGER_TRANSFER_START );
9363  </code>
9364  Remarks:
9365  This function implements an operation of the ChannelXTrigger feature.
9366  This feature may not be available on all devices. Please refer to the
9367  specific device data sheet to determine availability or use the
9368  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9369  determine whether this feature is available.
9370 */
9371 
9372 bool
9374  DMA_MODULE_ID index ,
9375  DMA_CHANNEL channel ,
9376  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9377 //******************************************************************************
9378 /* Function:
9379  void PLIB_DMA_ChannelXTriggerDisable ( DMA_MODULE_ID index,
9380  DMA_CHANNEL channel,
9381  DMA_CHANNEL_TRIGGER_TYPE trigger )
9382  Summary:
9383  Disables the DMA transfer abort via a matching interrupt (specified by the IRQ).
9384  Description:
9385  This function disables the DMA transfer abort via a matching interrupt
9386  (specified by the IRQ). The interrupt number IRQ is ignored and does not terminate
9387  a transfer.
9388  Precondition:
9389  None.
9390  Parameters:
9391  channel - One of the possible DMA channels listed by DMA_CHANNEL
9392  trigger - Type of trigger (transfer start/abort/pattern match abort)
9393  Returns:
9394  None.
9395  Example:
9396  <code>
9397  PLIB_DMA_ChannelXTriggerDisable ( DMA_ID_0,
9398  DMA_CHANNEL_4,
9399  DMA_CHANNEL_TRIGGER_PATTERN_MATCH_ABORT );
9400  </code>
9401  Remarks:
9402  This function implements an operation of the ChannelXTrigger feature.
9403  This feature may not be available on all devices. Please refer to the
9404  specific device data sheet to determine availability or use the
9405  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9406  determine whether this feature is available.
9407 */
9408 
9409 void
9411  DMA_MODULE_ID index ,
9412  DMA_CHANNEL channel ,
9413  DMA_CHANNEL_TRIGGER_TYPE trigger ) ;
9414 //******************************************************************************
9415 /* Function:
9416  void PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_MODULE_ID index,
9417  DMA_CHANNEL channel)
9418  Summary:
9419  Gets the source number for the DMA channel interrupts.
9420  Description:
9421  This function returns the interrupt source number for the specified
9422  DMA channel.
9423  Precondition:
9424  None.
9425  Parameters:
9426  channel - One of the possible DMA channels listed by DMA_CHANNEL
9427  Returns:
9428  None.
9429  Example:
9430  <code>
9431  PLIB_DMA_ChannelXTriggerSourceNumberGet ( DMA_ID_0,
9432  DMA_CHANNEL_4);
9433  </code>
9434  Remarks:
9435  This function implements an operation of the ChannelXTrigger feature.
9436  This feature may not be available on all devices. Please refer to the
9437  specific device data sheet to determine availability or use the
9438  PLIB_DMA_ExistsChannelXTrigger function in your application to automatically
9439  determine whether this feature is available.
9440 */
9441 
9442 DMA_CHANNEL_INT_SOURCE
9444  DMA_MODULE_ID index ,
9445  DMA_CHANNEL channel ) ;
9446 //******************************************************************************
9447 /* Function:
9448  void PLIB_DMA_ChannelXStartIRQSet ( DMA_MODULE_ID index,
9449  DMA_CHANNEL channel,
9450  DMA_TRIGGER_SOURCE IRQnum )
9451  Summary:
9452  Sets the IRQ to initiate the DMA transfer on the specified channel.
9453  Description:
9454  This function sets the IRQ to initiate the DMA transfer on the specified channel.
9455  (IRQ to start the channel transfer.)
9456  Precondition:
9457  None.
9458  Parameters:
9459  channel - One of the possible DMA channels listed by DMA_CHANNEL
9460  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9461  Returns:
9462  None.
9463  Example:
9464  <code>
9465  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_OUTPUT_COMPARE_1;
9466  PLIB_DMA_ChannelXStartIRQSet ( DMA_ID_0,
9467  DMA_CHANNEL_4,
9468  irq );
9469  </code>
9470  Remarks:
9471  This function implements an operation of the ChannelXStartIRQ feature.
9472  This feature may not be available on all devices. Please refer to the
9473  specific device data sheet to determine availability or use the
9474  PLIB_DMA_ExistsChannelXStartIRQ function in your application to automatically
9475  determine whether this feature is available.
9476 */
9477 
9478 void
9480  DMA_MODULE_ID index ,
9481  DMA_CHANNEL channel ,
9482  DMA_TRIGGER_SOURCE IRQnum ) ;
9483 //******************************************************************************
9484 /* Function:
9485  void PLIB_DMA_ChannelXAbortIRQSet ( DMA_MODULE_ID index,
9486  DMA_CHANNEL channel,
9487  DMA_TRIGGER_SOURCE IRQ )
9488  Summary:
9489  Sets the IRQ to abort the DMA transfer on the specified channel.
9490  Description:
9491  This function sets the IRQ to abort the DMA transfer on the specified channel.
9492  (IRQ to start the channel transfer.)
9493  Precondition:
9494  None.
9495  Parameters:
9496  channel - One of the possible DMA channels listed by DMA_CHANNEL
9497  IRQnum - The IRQ number of the trigger source of type DMA_TRIGGER_SOURCE
9498  Returns:
9499  None.
9500  Example:
9501  <code>
9502  DMA_TRIGGER_SOURCE irq = DMA_TRIGGER_TIMER_CORE;
9503  PLIB_DMA_ChannelXAbortIRQSet ( DMA_ID_0,
9504  DMA_CHANNEL_4,
9505  irq );
9506  </code>
9507  Remarks:
9508  This function implements an operation of the ChannelXAbortIRQ feature.
9509  This feature may not be available on all devices. Please refer to the
9510  specific device data sheet to determine availability or use the
9511  PLIB_DMA_ExistsChannelXAbortIRQ function in your application to automatically
9512  determine whether this feature is available.
9513 */
9514 
9515 void
9517  DMA_MODULE_ID index ,
9518  DMA_CHANNEL channel ,
9519  DMA_TRIGGER_SOURCE IRQ ) ;
9520 //******************************************************************************
9521 /* Function:
9522  void PLIB_DMA_ChannelXDataSizeSelect ( DMA_MODULE_ID index,
9523  DMA_CHANNEL channel,
9524  DMA_CHANNEL_DATA_SIZE channelDataSize )
9525  Summary:
9526  Selects the data size for the specified channel.
9527  Description:
9528  This function selects the data size for the specified channel.
9529  Precondition:
9530  None.
9531  Parameters:
9532  channel - One of the possible DMA channels listed by DMA_CHANNEL
9533  channelDataSize - One of the possible data sizes listed by DMA_CHANNEL_DATA_SIZE
9534  Returns:
9535  None.
9536  Example:
9537  <code>
9538  DMA_CHANNEL_DATA_SIZE channelDataSize = DMA_CHANNEL_DATA_8;
9539  PLIB_DMA_ChannelXDataSizeSelect ( DMA_ID_0,
9540  DMA_CHANNEL_4,
9541  channelDataSize );
9542  </code>
9543  Remarks:
9544  This feature is not available on all devices. Please refer to the specific
9545  device data sheet to determine availability.
9546 */
9547 
9548 void
9550  DMA_MODULE_ID index ,
9551  DMA_CHANNEL channel ,
9552  DMA_CHANNEL_DATA_SIZE channelDataSize ) ;
9553 //******************************************************************************
9554 /* Function:
9555  DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet ( DMA_MODULE_ID index,
9556  DMA_CHANNEL channel )
9557  Summary:
9558  Returns the current data size for the specified channel.
9559  Description:
9560  This function returns the current data size for the specified channel.
9561  Precondition:
9562  None.
9563  Parameters:
9564  channel - One of the possible DMA channels listed by DMA_CHANNEL
9565  Returns:
9566  - channelDataSize - One of the possible data sizes listed by
9567  DMA_CHANNEL_DATA_SIZE
9568  Example:
9569  <code>
9570  DMA_CHANNEL_DATA_SIZE channelDataSize;
9571  channelDataSize = PLIB_DMA_ChannelXDataSizeGet( DMA_ID_0,
9572  DMA_CHANNEL_4 );
9573  </code>
9574  Remarks:
9575  This feature is not available on all devices. Please refer to the specific
9576  device data sheet to determine availability.
9577 */
9578 
9579 DMA_CHANNEL_DATA_SIZE
9581  DMA_MODULE_ID index ,
9582  DMA_CHANNEL channel ) ;
9583 //******************************************************************************
9584 /* Function:
9585  void PLIB_DMA_ChannelXOperatingTransferModeSelect (
9586  DMA_MODULE_ID index,
9587  DMA_CHANNEL channel,
9588  DMA_TRANSFER_MODE channeltransferMode )
9589  Summary:
9590  Selects the transfer/operating mode for the specified channel.
9591  Description:
9592  This function selects the transfer/operating mode for the specified channel.
9593  (Transfer mode and operating mode are used interchangeably.)
9594  Precondition:
9595  None.
9596  Parameters:
9597  channel - One of the possible DMA channels listed by DMA_CHANNEL
9598  channeltransferMode - One of the possible operating/transfer modes listed by
9599  DMA_TRANSFER_MODE
9600  Returns:
9601  None.
9602  Example:
9603  <code>
9604  DMA_TRANSFER_MODE channeltransferMode = DMA_MODE_REPEATED_CONTINUOUS;
9605  PLIB_DMA_ChannelXOperatingTransferModeSelect ( DMA_ID_0,
9606  DMA_CHANNEL_4,
9607  channeltransferMode );
9608  </code>
9609  Remarks:
9610  This feature is not available on all devices. Please refer to the specific
9611  device data sheet to determine availability.
9612 */
9613 
9614 void
9616  DMA_MODULE_ID index ,
9617  DMA_CHANNEL channel ,
9618  DMA_TRANSFER_MODE channeltransferMode ) ;
9619 //******************************************************************************
9620 /* Function:
9621  DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet (
9622  DMA_MODULE_ID index,
9623  DMA_CHANNEL channel )
9624  Summary:
9625  Returns the current transfer/operating mode for the specified channel.
9626  Description:
9627  This function returns the current transfer/operating mode for the specified channel.
9628  (Transfer mode and operating mode are used interchangeably.)
9629  Precondition:
9630  None.
9631  Parameters:
9632  channel - One of the possible DMA channels listed by DMA_CHANNEL
9633  Returns:
9634  - channeltransferMode - One of the possible operating/transfer modes listed
9635  by DMA_TRANSFER_MODE
9636  Example:
9637  <code>
9638  DMA_TRANSFER_MODE channeltransferMode;
9639  channeltransferMode = PLIB_DMA_ChannelXOperatingTransferModeGet (
9640  DMA_ID_0,
9641  DMA_CHANNEL_4 );
9642  </code>
9643  Remarks:
9644  This feature is not available on all devices. Please refer to the specific
9645  device data sheet to determine availability.
9646 */
9647 
9648 DMA_TRANSFER_MODE
9650  DMA_MODULE_ID index ,
9651  DMA_CHANNEL channel ) ;
9652 //******************************************************************************
9653 /* Function:
9654  void PLIB_DMA_ChannelXReloadEnable( DMA_MODULE_ID index,
9655  DMA_CHANNEL channel )
9656  Summary:
9657  Enables reloading of the address and count registers.
9658  Description:
9659  This function enables reloading of the address and count registers. The source,
9660  destination address, and the DMA count registers are reloaded to their previous
9661  values upon the start of the next operation.
9662  Precondition:
9663  None.
9664  Parameters:
9665  channel - One of the possible DMA channels listed by DMA_CHANNEL
9666  Returns:
9667  None.
9668  Example:
9669  <code>
9670  PLIB_DMA_ChannelXReloadEnable ( DMA_ID_0,
9671  DMA_CHANNEL_4 );
9672  </code>
9673  Remarks:
9674  This feature is not available on all devices. Please refer to the specific
9675  device data sheet to determine availability.
9676 */
9677 
9678 void
9680  DMA_MODULE_ID index ,
9681  DMA_CHANNEL channel ) ;
9682 //******************************************************************************
9683 /* Function:
9684  bool PLIB_DMA_ChannelXReloadIsEnabled ( DMA_MODULE_ID index,
9685  DMA_CHANNEL channel )
9686  Summary:
9687  Returns the address and count registers reload enable status.
9688  Description:
9689  This function returns the address and count registers reload enable status.
9690  Precondition:
9691  None.
9692  Parameters:
9693  channel - One of the possible DMA channels listed by DMA_CHANNEL
9694  Returns:
9695  - true - The address and count registers reload is enabled
9696  - false - The address and count registers reload is disabled
9697  Example:
9698  <code>
9699  bool chAddressCountReloadStatus;
9700  chAddressCountReloadStatus = PLIB_DMA_ChannelXReloadIsEnabled (
9701  DMA_ID_0,
9702  DMA_CHANNEL_4 );
9703  </code>
9704  Remarks:
9705  This feature is not available on all devices. Please refer to the specific
9706  device data sheet to determine availability.
9707 */
9708 
9709 bool
9711  DMA_MODULE_ID index ,
9712  DMA_CHANNEL channel ) ;
9713 //******************************************************************************
9714 /* Function:
9715  void PLIB_DMA_ChannelXReloadDisable ( DMA_MODULE_ID index,
9716  DMA_CHANNEL channel )
9717  Summary:
9718  Disables reloading of the address and count registers.
9719  Description:
9720  This function disables reloading of the address and count registers. The source, destination
9721  address, and the DMA count registers are not reloaded to their previous values upon
9722  the start of the next operation.
9723  Precondition:
9724  None.
9725  Parameters:
9726  channel - One of the possible DMA channels listed by DMA_CHANNEL
9727  Returns:
9728  None.
9729  Example:
9730  <code>
9731  PLIB_DMA_ChannelXReloadDisable ( DMA_ID_0,
9732  DMA_CHANNEL_4 );
9733  </code>
9734  Remarks:
9735  This feature is not available on all devices. Please refer to the specific
9736  device data sheet to determine availability.
9737 */
9738 
9739 void
9741  DMA_MODULE_ID index ,
9742  DMA_CHANNEL channel ) ;
9743 //******************************************************************************
9744 /* Function:
9745  void PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_MODULE_ID index,
9746  DMA_CHANNEL channel )
9747  Summary:
9748  Enables the Null Write mode.
9749  Description:
9750  This function enables the Null Write mode. A dummy write is initiated to the
9751  source address for every write to the destination address.
9752  Precondition:
9753  None.
9754  Parameters:
9755  channel - One of the possible DMA channels listed by DMA_CHANNEL
9756  Returns:
9757  None.
9758  Example:
9759  <code>
9760  PLIB_DMA_ChannelXNullWriteModeEnable ( DMA_ID_0,
9761  DMA_CHANNEL_4 );
9762  </code>
9763  Remarks:
9764  This feature is not available on all devices. Please refer to the specific
9765  device data sheet to determine availability.
9766 */
9767 
9768 void
9770  DMA_MODULE_ID index ,
9771  DMA_CHANNEL channel ) ;
9772 //******************************************************************************
9773 /* Function:
9774  bool PLIB_DMA_ChannelXNullWriteModeIsEnabled ( DMA_MODULE_ID index,
9775  DMA_CHANNEL channel )
9776  Summary:
9777  Returns the enable status of the Null Write mode for the specified channel.
9778  Description:
9779  This function returns the enable status of the Null Write mode for the specified channel.
9780  Precondition:
9781  None.
9782  Parameters:
9783  channel - One of the possible DMA channels listed by DMA_CHANNEL
9784  Returns:
9785  - true - Null write mode is enabled for this channel
9786  - false - Null write mode is disabled for this channel
9787  Example:
9788  <code>
9789  bool chNullWriteStatus;
9790  chNullWriteStatus = PLIB_DMA_ChannelXNullWriteModeIsEnabled (
9791  DMA_ID_0,
9792  DMA_CHANNEL_4 );
9793  </code>
9794  Remarks:
9795  This feature is not available on all devices. Please refer to the specific
9796  device data sheet to determine availability.
9797 */
9798 
9799 bool
9801  DMA_MODULE_ID index ,
9802  DMA_CHANNEL channel ) ;
9803 //******************************************************************************
9804 /* Function:
9805  void PLIB_DMA_ChannelXNullWriteModeDisable( DMA_MODULE_ID index,
9806  DMA_CHANNEL channel )
9807  Summary:
9808  Disables the Null Write mode.
9809  Description:
9810  This function disables the Null Write mode. No dummy write is initiated.
9811  Precondition:
9812  None.
9813  Parameters:
9814  channel - One of the possible DMA channels listed by DMA_CHANNEL
9815  Returns:
9816  None.
9817  Example:
9818  <code>
9819  PLIB_DMA_ChannelXNullWriteModeDisable ( DMA_ID_0,
9820  DMA_CHANNEL_4 );
9821  </code>
9822  Remarks:
9823  This feature is not available on all devices. Please refer to the specific
9824  device data sheet to determine availability.
9825 */
9826 
9827 void
9829  DMA_MODULE_ID index ,
9830  DMA_CHANNEL channel ) ;
9831 // *****************************************************************************
9832 // *****************************************************************************
9833 // Section: DMA start/end functions
9834 // *****************************************************************************
9835 // *****************************************************************************
9836 //******************************************************************************
9837 /* Function:
9838  void PLIB_DMA_StartTransferSet ( DMA_MODULE_ID index,
9839  DMA_CHANNEL channel )
9840  Summary:
9841  Initiates transfer on the specified channel.
9842  Description:
9843  This function initiates transfer on the specified channel. This is a forced transfer
9844  controlled via software.
9845  Precondition:
9846  None.
9847  Parameters:
9848  channel - One of the possible DMA channels listed by DMA_CHANNEL
9849  Returns:
9850  None.
9851  Example:
9852  <code>
9853  PLIB_DMA_StartTransferSet ( DMA_ID_0,
9854  DMA_CHANNEL_4 );
9855  </code>
9856  Remarks:
9857  This function implements an operation of the StartTransfer feature.
9858  This feature may not be available on all devices. Please refer to the
9859  specific device data sheet to determine availability or use the
9860  PLIB_DMA_ExistsStartTransfer function in your application to automatically
9861  determine whether this feature is available.
9862 */
9863 
9864 void
9866  DMA_MODULE_ID index ,
9867  DMA_CHANNEL channel ) ;
9868 //******************************************************************************
9869 /* Function:
9870  void PLIB_DMA_AbortTransferSet ( DMA_MODULE_ID index,
9871  DMA_CHANNEL channel )
9872  Summary:
9873  Aborts transfer on the specified channel.
9874  Description:
9875  This function aborts transfer on the specified channel. This is a forced abort
9876  controlled via software.
9877  Precondition:
9878  None.
9879  Parameters:
9880  channel - One of the possible DMA channels listed by DMA_CHANNEL
9881  Returns:
9882  None.
9883  Example:
9884  <code>
9885  PLIB_DMA_AbortTransferSet ( DMA_ID_0,
9886  DMA_CHANNEL_4 );
9887  </code>
9888  Remarks:
9889  This function implements an operation of the AbortTransfer feature.
9890  This feature may not be available on all devices. Please refer to the
9891  specific device data sheet to determine availability or use the
9892  PLIB_DMA_ExistsAbortTransfer function in your application to automatically
9893  determine whether this feature is available.
9894 */
9895 
9896 void
9898  DMA_MODULE_ID index ,
9899  DMA_CHANNEL channel ) ;
9900 // *****************************************************************************
9901 // *****************************************************************************
9902 // Section: DMA General Configuration functions
9903 // *****************************************************************************
9904 // *****************************************************************************
9905 //******************************************************************************
9906 /* Function:
9907  void PLIB_DMA_BusyActiveSet ( DMA_MODULE_ID index )
9908  Summary:
9909  Sets the BUSY bit of the DMA controller.
9910  Description:
9911  This function sets the BUSY bit of the DMA controller. The DMA module is active.
9912  Precondition:
9913  None.
9914  Parameters:
9915  None.
9916  Returns:
9917  None.
9918  Example:
9919  <code>
9920  PLIB_DMA_BusyActiveSet( DMA_ID_0 );
9921  </code>
9922  Remarks:
9923  This function implements an operation of the Busy feature.
9924  This feature may not be available on all devices. Please refer to the
9925  specific device data sheet to determine availability or use the
9926  PLIB_DMA_ExistsBusy function in your application to automatically
9927  determine whether this feature is available.
9928 */
9929 
9930 void
9932  DMA_MODULE_ID index ) ;
9933 //******************************************************************************
9934 /* Function:
9935  void PLIB_DMA_BusyActiveReset ( DMA_MODULE_ID index )
9936  Summary:
9937  Resets the BUSY bit of the DMA controller.
9938  Description:
9939  This function resets the BUSY bit of the DMA controller. The DMA module is
9940  disabled and is not actively transferring data.
9941  Precondition:
9942  None.
9943  Parameters:
9944  None.
9945  Returns:
9946  None.
9947  Example:
9948  <code>
9949  PLIB_DMA_BusyActiveReset( DMA_ID_0 );
9950  </code>
9951  Remarks:
9952  This function implements an operation of the Busy feature.
9953  This feature may not be available on all devices. Please refer to the
9954  specific device data sheet to determine availability or use the
9955  PLIB_DMA_ExistsBusy function in your application to automatically
9956  determine whether this feature is available.
9957 */
9958 
9959 void
9961  DMA_MODULE_ID index ) ;
9962 //******************************************************************************
9963 /* Function:
9964  bool PLIB_DMA_IsBusy ( DMA_MODULE_ID index )
9965  Summary:
9966  Gets the BUSY bit of the DMA controller.
9967  Description:
9968  This function gets the BUSY bit of the DMA controller.
9969  Precondition:
9970  None.
9971  Parameters:
9972  None.
9973  Returns:
9974  - true - DMA module is active
9975  - false - DMA module is disabled and is not actively transferring data
9976  Example:
9977  <code>
9978  bool dmaBusyStatus;
9979  dmaBusyStatus = PLIB_DMA_IsBusy( DMA_ID_0 );
9980  </code>
9981  Remarks:
9982  This function implements an operation of the Busy feature.
9983  This feature may not be available on all devices. Please refer to the
9984  specific device data sheet to determine availability or use the
9985  PLIB_DMA_ExistsBusy function in your application to automatically
9986  determine whether this feature is available.
9987 */
9988 
9989 bool
9990  PLIB_DMA_IsBusy (
9991  DMA_MODULE_ID index ) ;
9992 //******************************************************************************
9993 /* Function:
9994  void PLIB_DMA_SuspendEnable ( DMA_MODULE_ID index )
9995  Summary:
9996  DMA transfers are suspended to allow uninterrupted access by the CPU to the data bus.
9997  Description:
9998  This function suspends the DMA transfers to allow uninterrupted access
9999  by the CPU to the data bus.
10000  Precondition:
10001  None.
10002  Parameters:
10003  None.
10004  Returns:
10005  None.
10006  Example:
10007  <code>
10008  PLIB_DMA_SuspendEnable( DMA_ID_0 );
10009  </code>
10010  Remarks:
10011  This function implements an operation of the Suspend feature.
10012  This feature may not be available on all devices. Please refer to the
10013  specific device data sheet to determine availability or use the
10014  PLIB_DMA_ExistsSuspend function in your application to automatically
10015  determine whether this feature is available.
10016 */
10017 
10018 void
10020  DMA_MODULE_ID index ) ;
10021 //******************************************************************************
10022 /* Function:
10023  void PLIB_DMA_SuspendDisable ( DMA_MODULE_ID index )
10024  Summary:
10025  DMA suspend is disabled and the DMA module operates normally.
10026  Description:
10027  This function disables the DMA suspend. The DMA module continues to operate
10028  normally.
10029  Precondition:
10030  None.
10031  Parameters:
10032  None.
10033  Returns:
10034  None.
10035  Example:
10036  <code>
10037  PLIB_DMA_SuspendDisable( DMA_ID_0 );
10038  </code>
10039  Remarks:
10040  This function implements an operation of the Suspend feature.
10041  This feature may not be available on all devices. Please refer to the
10042  specific device data sheet to determine availability or use the
10043  PLIB_DMA_ExistsSuspend function in your application to automatically
10044  determine whether this feature is available.
10045 */
10046 
10047 void
10049  DMA_MODULE_ID index ) ;
10050 //******************************************************************************
10051 /* Function:
10052  bool PLIB_DMA_SuspendIsEnabled ( DMA_MODULE_ID index )
10053  Summary:
10054  Returns the DMA suspend status.
10055  Description:
10056  This function returns the DMA suspend status.
10057  Precondition:
10058  None.
10059  Parameters:
10060  None.
10061  Returns:
10062  - true - The DMA transfers are suspended
10063  - false - The DMA operates normally
10064  Example:
10065  <code>
10066  bool dmaSuspendStatus;
10067  dmaSuspendStatus = PLIB_DMA_SuspendIsEnabled( DMA_ID_0 );
10068  </code>
10069  Remarks:
10070  This function implements an operation of the Suspend feature.
10071  This feature may not be available on all devices. Please refer to the
10072  specific device data sheet to determine availability or use the
10073  PLIB_DMA_ExistsSuspend function in your application to automatically
10074  determine whether this feature is available.
10075 */
10076 
10077 bool
10079  DMA_MODULE_ID index ) ;
10080 //******************************************************************************
10081 /* Function:
10082  void PLIB_DMA_StopInIdleEnable ( DMA_MODULE_ID index )
10083  Summary:
10084  DMA transfers are halted during Idle mode.
10085  Description:
10086  This function halts DMA transfers during Idle mode.
10087  Precondition:
10088  None.
10089  Parameters:
10090  None.
10091  Returns:
10092  None.
10093  Example:
10094  <code>
10095  PLIB_DMA_StopInIdleEnable( DMA_ID_0 );
10096  </code>
10097  Remarks:
10098  This function implements an operation of the StopInIdle feature.
10099  This feature may not be available on all devices. Please refer to the
10100  specific device data sheet to determine availability or use the
10101  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10102  determine whether this feature is available.
10103 */
10104 
10105 void
10107  DMA_MODULE_ID index ) ;
10108 //******************************************************************************
10109 /* Function:
10110  void PLIB_DMA_StopInIdleDisable ( DMA_MODULE_ID index )
10111  Summary:
10112  DMA transfers continue during Idle mode.
10113  Description:
10114  This function causes DMA transfers to continue during Idle mode.
10115  Precondition:
10116  None.
10117  Parameters:
10118  None.
10119  Returns:
10120  None.
10121  Example:
10122  <code>
10123  PLIB_DMA_StopInIdleDisable( DMA_ID_0 );
10124  </code>
10125  Remarks:
10126  This function implements an operation of the StopInIdle feature.
10127  This feature may not be available on all devices. Please refer to the
10128  specific device data sheet to determine availability or use the
10129  PLIB_DMA_ExistsStopInIdle function in your application to automatically
10130  determine whether this feature is available.
10131 */
10132 
10133 void
10135  DMA_MODULE_ID index ) ;
10136 //******************************************************************************
10137 /* Function:
10138  void PLIB_DMA_Enable ( DMA_MODULE_ID index )
10139  Summary:
10140  DMA module is enabled.
10141  Description:
10142  This function enables the DMA module.
10143  Precondition:
10144  None.
10145  Parameters:
10146  None.
10147  Returns:
10148  None.
10149  Example:
10150  <code>
10151  PLIB_DMA_Enable( DMA_ID_0 );
10152  </code>
10153  Remarks:
10154  This function implements an operation of the EnableControl feature.
10155  This feature may not be available on all devices. Please refer to the
10156  specific device data sheet to determine availability or use the
10157  PLIB_DMA_ExistsEnableControl function in your application to automatically
10158  determine whether this feature is available.
10159 */
10160 
10161 void
10162  PLIB_DMA_Enable (
10163  DMA_MODULE_ID index ) ;
10164 //******************************************************************************
10165 /* Function:
10166  bool PLIB_DMA_IsEnabled ( DMA_MODULE_ID index )
10167  Summary:
10168  Returns the DMA module enable status.
10169  Description:
10170  This function returns the DMA module enable status.
10171  Precondition:
10172  None.
10173  Parameters:
10174  None.
10175  Returns:
10176  - true - The DMA is enabled
10177  - false - The DMA is disabled
10178  Example:
10179  <code>
10180  PLIB_DMA_IsEnabled( DMA_ID_0 );
10181  </code>
10182  Remarks:
10183  This function implements an operation of the EnableControl feature.
10184  This feature may not be available on all devices. Please refer to the
10185  specific device data sheet to determine availability or use the
10186  PLIB_DMA_ExistsEnableControl function in your application to automatically
10187  determine whether this feature is available.
10188 */
10189 
10190 bool
10192  DMA_MODULE_ID index ) ;
10193 //******************************************************************************
10194 /* Function:
10195  void PLIB_DMA_Disable ( DMA_MODULE_ID index )
10196  Summary:
10197  DMA module is disabled.
10198  Description:
10199  This function disables the DMA module.
10200  Precondition:
10201  None.
10202  Parameters:
10203  None.
10204  Returns:
10205  None.
10206  Example:
10207  <code>
10208  PLIB_DMA_Disable( DMA_ID_0 );
10209  </code>
10210  Remarks:
10211  This function implements an operation of the EnableControl feature.
10212  This feature may not be available on all devices. Please refer to the
10213  specific device data sheet to determine availability or use the
10214  PLIB_DMA_ExistsEnableControl function in your application to automatically
10215  determine whether this feature is available.
10216 */
10217 
10218 void
10220  DMA_MODULE_ID index ) ;
10221 // *****************************************************************************
10222 // *****************************************************************************
10223 // Section: DMA status functions
10224 // *****************************************************************************
10225 // *****************************************************************************
10226 //******************************************************************************
10227 /* Function:
10228  uint8_t PLIB_DMA_ChannelBitsGet ( DMA_MODULE_ID index )
10229  Summary:
10230  Returns the DMA channel bits.
10231  Description:
10232  This function returns the channel bits.
10233  Precondition:
10234  None.
10235  Parameters:
10236  None.
10237  Returns:
10238  - uint8_t - DMA channel bits
10239  Example:
10240  <code>
10241  uint8_t dmaChBits;
10242  dmaChBits = PLIB_DMA_ChannelBitsGet( DMA_ID_0 );
10243  </code>
10244  Remarks:
10245  This function implements an operation of the ChannelBits feature.
10246  This feature may not be available on all devices. Please refer to the
10247  specific device data sheet to determine availability or use the
10248  PLIB_DMA_ExistsChannelBits function in your application to automatically
10249  determine whether this feature is available.
10250 */
10251 
10252 uint8_t
10254  DMA_MODULE_ID index ) ;
10255 //******************************************************************************
10256 /* Function:
10257  bool PLIB_DMA_LastBusAccessIsRead ( DMA_MODULE_ID index )
10258  Summary:
10259  Returns true if the last DMA bus access was a read.
10260  Description:
10261  This function returns true if the last DMA bus access was a read.
10262  Precondition:
10263  None.
10264  Parameters:
10265  None.
10266  Returns:
10267  - true - The last bus access was a read
10268  - false - The last bus access was not a read
10269  Example:
10270  <code>
10271  bool dmaLastBusAccessType;
10272  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsRead( DMA_ID_0 );
10273  </code>
10274  Remarks:
10275  This function implements an operation of the LastBusAccess feature.
10276  This feature may not be available on all devices. Please refer to the
10277  specific device data sheet to determine availability or use the
10278  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10279  determine whether this feature is available.
10280 */
10281 
10282 bool
10284  DMA_MODULE_ID index ) ;
10285 //******************************************************************************
10286 /* Function:
10287  bool PLIB_DMA_LastBusAccessIsWrite ( DMA_MODULE_ID index )
10288  Summary:
10289  Returns true if the last DMA bus access was a write.
10290  Description:
10291  This function returns true if the last DMA bus access was a write operation.
10292  Precondition:
10293  None.
10294  Parameters:
10295  None.
10296  Returns:
10297  - true - The last bus access was a write operation
10298  - false - The last bus access was not a write operation
10299  Example:
10300  <code>
10301  bool dmaLastBusAccessType;
10302  dmaLastBusAccessType = PLIB_DMA_LastBusAccessIsWrite( DMA_ID_0 );
10303  </code>
10304  Remarks:
10305  This function implements an operation of the LastBusAccess feature.
10306  This feature may not be available on all devices. Please refer to the
10307  specific device data sheet to determine availability or use the
10308  PLIB_DMA_ExistsLastBusAccess function in your application to automatically
10309  determine whether this feature is available.
10310 */
10311 
10312 bool
10314  DMA_MODULE_ID index ) ;
10315 //******************************************************************************
10316 /* Function:
10317  uint32_t PLIB_DMA_RecentAddressAccessed ( DMA_MODULE_ID index )
10318  Summary:
10319  Returns the address of the most recent DMA access.
10320  Description:
10321  This function returns the address of the most recent DMA access.
10322  Precondition:
10323  None.
10324  Parameters:
10325  None.
10326  Returns:
10327  - uint32_t - The most recent address accessed by the DMA
10328  Example:
10329  <code>
10330  uint32_t dmaLastAddressAccessed;
10331  dmaLastAddressAccessed = PLIB_DMA_RecentAddressAccessed( DMA_ID_0 );
10332  </code>
10333  Remarks:
10334  This function implements an operation of the RecentAddress feature.
10335  This feature may not be available on all devices. Please refer to the
10336  specific device data sheet to determine availability or use the
10337  PLIB_DMA_ExistsRecentAddress function in your application to automatically
10338  determine whether this feature is available.
10339 */
10340 
10341 uint32_t
10343  DMA_MODULE_ID index ) ;
10344 // *****************************************************************************
10345 // *****************************************************************************
10346 // Section: DMA Module CRC Feature Interface Functions
10347 // *****************************************************************************
10348 // *****************************************************************************
10349 //******************************************************************************
10350 /* Function:
10351  void PLIB_DMA_CRCChannelSelect( DMA_MODULE_ID index,
10352  DMA_CHANNEL channel )
10353  Summary:
10354  Assigns the CRC to the specified DMA channel.
10355  Description:
10356  This function assigns the CRC feature to the specified channel.
10357  Precondition:
10358  None.
10359  Parameters:
10360  channel - One of the possible DMA channels listed by DMA_CHANNEL
10361  Returns:
10362  None.
10363  Example:
10364  <code>
10365  PLIB_DMA_CRCChannelSelect( DMA_ID_0,
10366  DMA_CHANNEL_5 );
10367  </code>
10368  Remarks:
10369  This function implements an operation of the CRCChannel feature.
10370  This feature may not be available on all devices. Please refer to the
10371  specific device data sheet to determine availability or use the
10372  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10373  determine whether this feature is available.
10374 */
10375 
10376 void
10378  DMA_MODULE_ID index ,
10379  DMA_CHANNEL channel ) ;
10380 //******************************************************************************
10381 /* Function:
10382  DMA_CHANNEL PLIB_DMA_CRCChannelGet ( DMA_MODULE_ID index )
10383  Summary:
10384  Returns the current DMA channel to which the CRC is assigned.
10385  Description:
10386  This function returns the current DMA channel to which the CRC is assigned.
10387  Precondition:
10388  None.
10389  Parameters:
10390  None.
10391  Returns:
10392  crcChannel - One of the possible DMA channels listed by DMA_CHANNEL
10393  Example:
10394  <code>
10395  DMA_CHANNEL crcChannel;
10396  crcChannel = PLIB_DMA_CRCChannelGet( DMA_ID_0 );
10397  </code>
10398  Remarks:
10399  This function implements an operation of the CRCChannel feature.
10400  This feature may not be available on all devices. Please refer to the
10401  specific device data sheet to determine availability or use the
10402  PLIB_DMA_ExistsCRCChannel function in your application to automatically
10403  determine whether this feature is available.
10404 */
10405 
10406 DMA_CHANNEL
10408  DMA_MODULE_ID index ) ;
10409 //******************************************************************************
10410 /* Function:
10411  void PLIB_DMA_CRCTypeSet ( DMA_MODULE_ID index,
10412  DMA_CRC_TYPE CRCType )
10413  Summary:
10414  Selects the DMA module CRC feature type.
10415  Description:
10416  This function selects the DMA module CRC feature type. The CRC feature will
10417  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10418  checksum.
10419  Precondition:
10420  None.
10421  Parameters:
10422  CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE
10423  Returns:
10424  None.
10425  Example:
10426  <code>
10427  PLIB_DMA_CRCTypeSet(DMA_ID_0,
10428  DMA_CRC_IP_HEADER );
10429  </code>
10430  Remarks:
10431  This function implements an operation of the CRCType feature.
10432  This feature may not be available on all devices. Please refer to the
10433  specific device data sheet to determine availability or use the
10434  PLIB_DMA_ExistsCRCType function in your application to automatically
10435  determine whether this feature is available.
10436 */
10437 
10438 void
10440  DMA_MODULE_ID index ,
10441  DMA_CRC_TYPE CRCType ) ;
10442 //******************************************************************************
10443 /* Function:
10444  DMA_CRC_TYPE PLIB_DMA_CRCTypeGet ( DMA_MODULE_ID index )
10445  Summary:
10446  Gets the current DMA module CRC feature type.
10447  Description:
10448  This function gets the DMA module CRC feature type. The CRC feature will
10449  compute either the IP header checksum or the Linear Shift Feedback Register (LFSR)
10450  checksum.
10451  Precondition:
10452  None.
10453  Parameters:
10454  None.
10455  Returns:
10456  - CRCType - One of the possible CRC checksums listed by DMA_CRC_TYPE.
10457  Example:
10458  <code>
10459  DMA_CRC_TYPE CRCType;
10460  CRCType = PLIB_DMA_CRCTypeGet( DMA_ID_0 );
10461  </code>
10462  Remarks:
10463  This function implements an operation of the CRCType feature.
10464  This feature may not be available on all devices. Please refer to the
10465  specific device data sheet to determine availability or use the
10466  PLIB_DMA_ExistsCRCType function in your application to automatically
10467  determine whether this feature is available.
10468 */
10469 
10470 DMA_CRC_TYPE
10472  DMA_MODULE_ID index ) ;
10473 //******************************************************************************
10474 /* Function:
10475  void PLIB_DMA_CRCAppendModeEnable ( DMA_MODULE_ID index )
10476  Summary:
10477  Enables the CRC append mode.
10478  Description:
10479  This function enables the CRC append mode. The DMA transfers data from the source
10480  into the CRC, but not to the destination. When a block transfer completes, the
10481  DMA writes the calculated CRC value to the location specified by the CHxDSA register.
10482  Precondition:
10483  None.
10484  Parameters:
10485  None.
10486  Returns:
10487  None.
10488  Example:
10489  <code>
10490  PLIB_DMA_CRCAppendModeEnable( DMA_ID_0 );
10491  </code>
10492  Remarks:
10493  This function implements an operation of the CRCAppendMode feature.
10494  This feature may not be available on all devices. Please refer to the
10495  specific device data sheet to determine availability or use the
10496  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10497  determine whether this feature is available.
10498 */
10499 
10500 void
10502  DMA_MODULE_ID index ) ;
10503 //******************************************************************************
10504 /* Function:
10505  bool PLIB_DMA_CRCAppendModeIsEnabled ( DMA_MODULE_ID index )
10506  Summary:
10507  Gets the enable status of the CRC append mode.
10508  Description:
10509  This function gets the enable status of the CRC append mode.
10510  Precondition:
10511  None.
10512  Parameters:
10513  None.
10514  Returns:
10515  - true - CRC append mode is enabled
10516  - false - CRC append mode is disabled
10517  Example:
10518  <code>
10519  bool DMAcrcAppendMode;
10520  DMAcrcAppendMode = PLIB_DMA_CRCAppendModeIsEnabled( DMA_ID_0 );
10521  </code>
10522  Remarks:
10523  This function implements an operation of the CRCAppendMode feature.
10524  This feature may not be available on all devices. Please refer to the
10525  specific device data sheet to determine availability or use the
10526  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10527  determine whether this feature is available.
10528 */
10529 
10530 bool
10532  DMA_MODULE_ID index ) ;
10533 //******************************************************************************
10534 /* Function:
10535  void PLIB_DMA_CRCAppendModeDisable ( DMA_MODULE_ID index )
10536  Summary:
10537  Disables the CRC append mode.
10538  Description:
10539  This function disables the CRC append mode. The DMA transfers data from the
10540  source through the CRC obeying WBO (DMA_MODULE_ID index, write byte order)
10541  as it writes the data to the destination.
10542  Precondition:
10543  None.
10544  Parameters:
10545  None.
10546  Returns:
10547  None.
10548  Example:
10549  <code>
10550  PLIB_DMA_CRCAppendModeDisable( DMA_ID_0 );
10551  </code>
10552  Remarks:
10553  This function implements an operation of the CRCAppendMode feature.
10554  This feature may not be available on all devices. Please refer to the
10555  specific device data sheet to determine availability or use the
10556  PLIB_DMA_ExistsCRCAppendMode function in your application to automatically
10557  determine whether this feature is available.
10558 */
10559 
10560 void
10562  DMA_MODULE_ID index ) ;
10563 //******************************************************************************
10564 /* Function:
10565  void PLIB_DMA_CRCEnable ( DMA_MODULE_ID index )
10566  Summary:
10567  Enables the DMA module CRC feature.
10568  Description:
10569  This function enables the DMA module CRC feature. The channel transfers are
10570  routed through the CRC.
10571  Precondition:
10572  None.
10573  Parameters:
10574  None.
10575  Returns:
10576  None.
10577  Example:
10578  <code>
10579  PLIB_DMA_CRCEnable( DMA_ID_0 );
10580  </code>
10581  Remarks:
10582  This function implements an operation of the CRC feature.
10583  This feature may not be available on all devices. Please refer to the
10584  specific device data sheet to determine availability or use the
10585  PLIB_DMA_ExistsCRC function in your application to automatically
10586  determine whether this feature is available.
10587 */
10588 
10589 void
10591  DMA_MODULE_ID index ) ;
10592 //******************************************************************************
10593 /* Function:
10594  bool PLIB_DMA_CRCIsEnabled ( DMA_MODULE_ID index )
10595  Summary:
10596  Gets the enable status of the CRC feature.
10597  Description:
10598  This function gets the enable status of the CRC feature.
10599  Precondition:
10600  None.
10601  Parameters:
10602  None.
10603  Returns:
10604  - true - The CRC feature is enabled
10605  - false - The CRC feature is disabled
10606  Example:
10607  <code>
10608  bool DMAcrcStatus;
10609  DMAcrcStatus = PLIB_DMA_CRCIsEnabled( DMA_ID_0 );
10610  </code>
10611  Remarks:
10612  This function implements an operation of the CRC feature.
10613  This feature may not be available on all devices. Please refer to the
10614  specific device data sheet to determine availability or use the
10615  PLIB_DMA_ExistsCRC function in your application to automatically
10616  determine whether this feature is available.
10617 */
10618 
10619 bool
10621  DMA_MODULE_ID index ) ;
10622 //******************************************************************************
10623 /* Function:
10624  void PLIB_DMA_CRCDisable ( DMA_MODULE_ID index )
10625  Summary:
10626  Disables the DMA module CRC feature.
10627  Description:
10628  This function disables the DMA module CRC feature. The channel transfers proceed
10629  normally.
10630  Precondition:
10631  None.
10632  Parameters:
10633  None.
10634  Returns:
10635  None.
10636  Example:
10637  <code>
10638  PLIB_DMA_CRCDisable( DMA_ID_0 );
10639  </code>
10640  Remarks:
10641  This function implements an operation of the CRC feature.
10642  This feature may not be available on all devices. Please refer to the
10643  specific device data sheet to determine availability or use the
10644  PLIB_DMA_ExistsCRC function in your application to automatically
10645  determine whether this feature is available.
10646 */
10647 
10648 void
10650  DMA_MODULE_ID index ) ;
10651 //******************************************************************************
10652 /* Function:
10653  void PLIB_DMA_CRCPolynomialLengthSet ( DMA_MODULE_ID index,
10654  uint8_t polyLength )
10655  Summary:
10656  Selects the polynomial length.
10657  Description:
10658  This function Selects the polynomial length.
10659  Precondition:
10660  None.
10661  Parameters:
10662  polyLength - Polynomial length
10663  Returns:
10664  None.
10665  Example:
10666  <code>
10667  uint8_t polyLength = 0x2;
10668  PLIB_DMA_CRCPolynomialLengthSet( DMA_ID_0, polyLength );
10669  </code>
10670  Remarks:
10671  This function implements an operation of the CRCPolynomialLength feature.
10672  This feature may not be available on all devices. Please refer to the
10673  specific device data sheet to determine availability or use the
10674  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10675  determine whether this feature is available.
10676 */
10677 
10678 void
10680  DMA_MODULE_ID index ,
10681  uint8_t polyLength ) ;
10682 //******************************************************************************
10683 /* Function:
10684  uint8_t PLIB_DMA_CRCPolynomialLengthGet ( DMA_MODULE_ID index )
10685  Summary:
10686  Gets the current polynomial length.
10687  Description:
10688  This function gets the current polynomial length.
10689  Precondition:
10690  None.
10691  Parameters:
10692  None.
10693  Returns:
10694  - uint8_t - Polynomial length
10695  Example:
10696  <code>
10697  uint8_t polyLength;
10698  polyLength = PLIB_DMA_CRCPolynomialLengthGet( DMA_ID_0 );
10699  </code>
10700  Remarks:
10701  This function implements an operation of the CRCPolynomialLength feature.
10702  This feature may not be available on all devices. Please refer to the
10703  specific device data sheet to determine availability or use the
10704  PLIB_DMA_ExistsCRCPolynomialLength function in your application to automatically
10705  determine whether this feature is available.
10706 */
10707 
10708 uint8_t
10710  DMA_MODULE_ID index ) ;
10711 //******************************************************************************
10712 /* Function:
10713  void PLIB_DMA_CRCBitOrderSelect ( DMA_MODULE_ID index,
10714  DMA_CRC_BIT_ORDER bitOrder )
10715  Summary:
10716  Selects the bit order for checksum calculation.
10717  Description:
10718  This function selects the bit order for checksum calculation.
10719  Precondition:
10720  None.
10721  Parameters:
10722  bitOrder - Specifies the bit order for CRC calculation
10723  Returns:
10724  None.
10725  Example:
10726  <code>
10727  PLIB_DMA_CRCBitOrderSelect ( DMA_ID_0,DMA_CRC_BIT_ORDER_LSB );
10728  </code>
10729  Remarks:
10730  This function implements an operation of the CRCBitOrder feature.
10731  This feature may not be available on all devices. Please refer to the
10732  specific device data sheet to determine availability or use the
10733  PLIB_DMA_ExistsCRCBitOrder function in your application to automatically
10734  determine whether this feature is available.
10735 */
10736 
10737 void
10739  DMA_MODULE_ID index ,
10740  DMA_CRC_BIT_ORDER bitOrder ) ;
10741 //******************************************************************************
10742 /* Function:
10743  void PLIB_DMA_CRCWriteByteOrderAlter ( DMA_MODULE_ID index )
10744  Summary:
10745  The source data is written to the destination reordered as defined by the
10746  BYTO<1:0> bits.
10747  Description:
10748  This function enables byte order alteration as specified by the BYTO<1:0> bits.
10749  The source data is written to the destination reordered as defined by the
10750  BYTO<1:0> bits.
10751  Precondition:
10752  None.
10753  Parameters:
10754  None.
10755  Returns:
10756  None.
10757  Example:
10758  <code>
10759  PLIB_DMA_CRCWriteByteOrderAlter ( DMA_ID_0 );
10760  </code>
10761  Remarks:
10762  This function implements an operation of the CRCWriteByteOrder feature.
10763  This feature may not be available on all devices. Please refer to the
10764  specific device data sheet to determine availability or use the
10765  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10766  determine whether this feature is available.
10767 */
10768 
10769 void
10771  DMA_MODULE_ID index ) ;
10772 //******************************************************************************
10773 /* Function:
10774  void PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_MODULE_ID index )
10775  Summary:
10776  The source data is written to the destination unaltered.
10777  Description:
10778  This function disables byte order alteration. The source data is written
10779  to the destination unaltered.
10780  Precondition:
10781  None.
10782  Parameters:
10783  None.
10784  Returns:
10785  None.
10786  Example:
10787  <code>
10788  PLIB_DMA_CRCWriteByteOrderMaintain ( DMA_ID_0 );
10789  </code>
10790  Remarks:
10791  This function implements an operation of the CRCWriteByteOrder feature.
10792  This feature may not be available on all devices. Please refer to the
10793  specific device data sheet to determine availability or use the
10794  PLIB_DMA_ExistsCRCWriteByteOrder function in your application to automatically
10795  determine whether this feature is available.
10796 */
10797 
10798 void
10800  DMA_MODULE_ID index ) ;
10801 //******************************************************************************
10802 /* Function:
10803  void PLIB_DMA_CRCByteOrderSelect ( DMA_MODULE_ID index,
10804  DMA_CRC_BYTE_ORDER byteOrder )
10805  Summary:
10806  Selects the byte order.
10807  Description:
10808  This function selects the byte order.
10809  Precondition:
10810  The WBO bit must be set to use this function.
10811  Parameters:
10812  byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10813  Returns:
10814  None.
10815  Example:
10816  <code>
10817  PLIB_DMA_CRCByteOrderSelect ( DMA_ID_0,
10818  DMA_CRC_SWAP_HALF_WORD_ON_WORD_BOUNDARY );
10819  </code>
10820  Remarks:
10821  This function implements an operation of the CRCByteOrder feature.
10822  This feature may not be available on all devices. Please refer to the
10823  specific device data sheet to determine availability or use the
10824  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10825  determine whether this feature is available.
10826 */
10827 
10828 void
10830  DMA_MODULE_ID index ,
10831  DMA_CRC_BYTE_ORDER byteOrder ) ;
10832 //******************************************************************************
10833 /* Function:
10834  DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet ( DMA_MODULE_ID index )
10835  Summary:
10836  Gets the current byte order selected by the DMA module CRC feature.
10837  Description:
10838  This function gets the current byte order selected by the DMA module CRC feature.
10839  Precondition:
10840  The WBO bit must be set to use this function.
10841  Parameters:
10842  None.
10843  Returns:
10844  - byteOrder - One of the possible byte orders specified by DMA_CRC_BYTE_ORDER
10845  Example:
10846  <code>
10847  DMA_CRC_BYTE_ORDER byteOrder;
10848  byteOrder = PLIB_DMA_CRCByteOrderGet ( DMA_ID_0 );
10849  </code>
10850  Remarks:
10851  This function implements an operation of the CRCByteOrder feature.
10852  This feature may not be available on all devices. Please refer to the
10853  specific device data sheet to determine availability or use the
10854  PLIB_DMA_ExistsCRCByteOrder function in your application to automatically
10855  determine whether this feature is available.
10856 */
10857 
10858 DMA_CRC_BYTE_ORDER
10860  DMA_MODULE_ID index ) ;
10861 //******************************************************************************
10862 /* Function:
10863  uint32_t PLIB_DMA_CRCDataRead ( DMA_MODULE_ID index )
10864  Summary:
10865  Reads the contents of the DMA CRC data register.
10866  Description:
10867  This function reads the contents of the DMA CRC data register.
10868  Precondition:
10869  None.
10870  Parameters:
10871  None.
10872  Returns:
10873  - uint32_t - 32-bit CRC data
10874  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10875  device data sheet to determine availability.
10876  Example:
10877  <code>
10878  uint32_t DMACRCdata;
10879  DMACRCdata = PLIB_DMA_CRCDataRead ( DMA_ID_0 );
10880  </code>
10881  Remarks:
10882  This function implements an operation of the CRCData feature.
10883  This feature may not be available on all devices. Please refer to the
10884  specific device data sheet to determine availability or use the
10885  PLIB_DMA_ExistsCRCData function in your application to automatically
10886  determine whether this feature is available.
10887 */
10888 
10889 uint32_t
10891  DMA_MODULE_ID index ) ;
10892 //******************************************************************************
10893 /* Function:
10894  void PLIB_DMA_CRCDataWrite ( DMA_MODULE_ID index,
10895  uint32_t DMACRCdata )
10896  Summary:
10897  Writes the contents of the DMA CRC data register with the specified data.
10898  Description:
10899  This function writes the contents of the DMA CRC data register.
10900  Precondition:
10901  None.
10902  Parameters:
10903  - DMACRCdata - 32-bit CRC data
10904  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10905  device data sheet to determine availability.
10906  Returns:
10907  None.
10908  Example:
10909  <code>
10910  uint32_t DMACRCdata = 0x0E0E0E;
10911  PLIB_DMA_CRCDataWrite ( DMA_ID_0, DMACRCdata );
10912  </code>
10913  Remarks:
10914  This function implements an operation of the CRCData feature.
10915  This feature may not be available on all devices. Please refer to the
10916  specific device data sheet to determine availability or use the
10917  PLIB_DMA_ExistsCRCData function in your application to automatically
10918  determine whether this feature is available.
10919 */
10920 
10921 void
10923  DMA_MODULE_ID index ,
10924  uint32_t DMACRCdata ) ;
10925 //******************************************************************************
10926 /* Function:
10927  uint32_t PLIB_DMA_CRCXOREnableGet ( DMA_MODULE_ID index )
10928  Summary:
10929  Reads the CRC XOR register.
10930  Description:
10931  This function reads the CRC XOR register.
10932  Precondition:
10933  None.
10934  Parameters:
10935  None.
10936  Returns:
10937  - uint32_t - 32-bit CRC XOR enable mask data
10938  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10939  device data sheet to determine availability.
10940  Example:
10941  <code>
10942  uint32_t DMACRCXORdata;
10943  DMACRCXORdata = PLIB_DMA_CRCXOREnableGet ( DMA_ID_0 );
10944  </code>
10945  Remarks:
10946  This function implements an operation of the CRCXOREnable feature.
10947  This feature may not be available on all devices. Please refer to the
10948  specific device data sheet to determine availability or use the
10949  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10950  determine whether this feature is available.
10951 */
10952 
10953 uint32_t
10955  DMA_MODULE_ID index ) ;
10956 //******************************************************************************
10957 /* Function:
10958  void PLIB_DMA_CRCXOREnableSet ( DMA_MODULE_ID index,
10959  uint32_t DMACRCXOREnableMask )
10960  Summary:
10961  Writes to the CRC XOR enable register as per the specified enable mask.
10962  Description:
10963  This function writes to the CRC XOR enable register as per the specified
10964  enable mask. Each enabled bit will be taken as input to the shift register.
10965  Precondition:
10966  None.
10967  Parameters:
10968  - DMACRCXOREnableMask - 32-bit CRC XOR enable mask data
10969  The CRC data (16-bit, 32-bit) is device-specific. Please refer to the specific
10970  device data sheet to determine availability.
10971  Returns:
10972  None.
10973  Example:
10974  <code>
10975  uint32_t DMACRCXOREnableMask = 0x05EFFFFF;
10976  PLIB_DMA_CRCXOREnableSet ( DMA_ID_0, DMACRCXOREnableMask );
10977  </code>
10978  Remarks:
10979  This function implements an operation of the CRCXOREnable feature.
10980  This feature may not be available on all devices. Please refer to the
10981  specific device data sheet to determine availability or use the
10982  PLIB_DMA_ExistsCRCXOREnable function in your application to automatically
10983  determine whether this feature is available.
10984 */
10985 
10986 void
10988  DMA_MODULE_ID index ,
10989  uint32_t DMACRCXOREnableMask ) ;
10990 // *****************************************************************************
10991 // *****************************************************************************
10992 // Section: DMA Address control Interface functions
10993 // *****************************************************************************
10994 // *****************************************************************************
10995 //******************************************************************************
10996 /* Function:
10997  uint32_t PLIB_DMA_ChannelXSourceStartAddressGet ( DMA_MODULE_ID index,
10998  DMA_CHANNEL dmaChannel )
10999  Summary:
11000  Reads the source start address configured for the specified channel.
11001  Description:
11002  This function reads the source start address configured for the specified
11003  channel.
11004  Precondition:
11005  None.
11006  Parameters:
11007  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11008  Returns:
11009  - uint32_t - The source start address configured for this channel
11010  Example:
11011  <code>
11012  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11013  uint32_t SourceStartAddress;
11014  SourceStartAddress = PLIB_DMA_ChannelXSourceStartAddressGet(DMA_ID_0,
11015  spiDMAChannel );
11016  </code>
11017  Remarks:
11018  This function implements an operation of the ChannelXSourceStartAddress feature.
11019  This feature may not be available on all devices. Please refer to the
11020  specific device data sheet to determine availability or use the
11021  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11022  determine whether this feature is available.
11023 */
11024 
11025 uint32_t
11027  DMA_MODULE_ID index ,
11028  DMA_CHANNEL dmaChannel ) ;
11029 //******************************************************************************
11030 /* Function:
11031  void PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_MODULE_ID index,
11032  DMA_CHANNEL dmaChannel,
11033  uint32_t sourceStartAddress)
11034  Summary:
11035  Writes the specified source start address into the register
11036  corresponding to the specified channel.
11037  Description:
11038  This function writes the specified Source start address into the register
11039  corresponding to the specified channel.
11040  Precondition:
11041  None.
11042  Parameters:
11043  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11044  sourceStartAddress - The source start address
11045  Returns:
11046  None.
11047  Example:
11048  <code>
11049  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11050  uint32_t sourceStartAddress = 0x00FDEA00;
11051  PLIB_DMA_ChannelXSourceStartAddressSet ( DMA_ID_0,
11052  spiDMAChannel,
11053  sourceStartAddress );
11054  </code>
11055  Remarks:
11056  This function implements an operation of the ChannelXSourceStartAddress feature.
11057  This feature may not be available on all devices. Please refer to the
11058  specific device data sheet to determine availability or use the
11059  PLIB_DMA_ExistsChannelXSourceStartAddress function in your application to automatically
11060  determine whether this feature is available.
11061 */
11062 
11063 void
11065  DMA_MODULE_ID index ,
11066  DMA_CHANNEL dmaChannel ,
11067  uint32_t sourceStartAddress ) ;
11068 //******************************************************************************
11069 /* Function:
11070  uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet ( DMA_MODULE_ID index,
11071  DMA_CHANNEL dmaChannel )
11072  Summary:
11073  Reads the destination start address configured for the specified channel.
11074  Description:
11075  This function reads the destination start address configured for the specified
11076  channel.
11077  Precondition:
11078  None.
11079  Parameters:
11080  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11081  Returns:
11082  - uint32_t - The destination start address configured for this channel
11083  Example:
11084  <code>
11085  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11086  uint32_t DestinationStartAddress;
11087  DestinationStartAddress = PLIB_DMA_ChannelXDestinationStartAddressGet (
11088  DMA_ID_0,
11089  spiDMAChannel );
11090  </code>
11091  Remarks:
11092  This function implements an operation of the ChannelXDestinationStartAddress feature.
11093  This feature may not be available on all devices. Please refer to the
11094  specific device data sheet to determine availability or use the
11095  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11096  determine whether this feature is available.
11097 */
11098 
11099 uint32_t
11101  DMA_MODULE_ID index ,
11102  DMA_CHANNEL dmaChannel ) ;
11103 //******************************************************************************
11104 /* Function:
11105  void PLIB_DMA_ChannelXDestinationStartAddressSet (
11106  DMA_MODULE_ID index,
11107  DMA_CHANNEL dmaChannel,
11108  uint32_t destinationStartAddress)
11109  Summary:
11110  Writes the specified destination start address into the register corresponding to
11111  the specified channel.
11112  Description:
11113  This function writes the specified destination start address into the register
11114  corresponding to the specified channel.
11115  Precondition:
11116  None.
11117  Parameters:
11118  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11119  destinationStartAddress - The destination start address
11120  Returns:
11121  None.
11122  Example:
11123  <code>
11124  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11125  uint32_t destinationStartAddress = 0x00FDEA00;
11126  PLIB_DMA_ChannelXDestinationStartAddressSet( DMA_ID_0,
11127  spiDMAChannel,
11128  destinationStartAddress );
11129  </code>
11130  Remarks:
11131  This function implements an operation of the ChannelXDestinationStartAddress feature.
11132  This feature may not be available on all devices. Please refer to the
11133  specific device data sheet to determine availability or use the
11134  PLIB_DMA_ExistsChannelXDestinationStartAddress function in your application to automatically
11135  determine whether this feature is available.
11136 */
11137 
11138 void
11140  DMA_MODULE_ID index ,
11141  DMA_CHANNEL dmaChannel ,
11142  uint32_t destinationStartAddress ) ;
11143 // *****************************************************************************
11144 // *****************************************************************************
11145 // Section: DMA Data control Interface functions
11146 // *****************************************************************************
11147 // *****************************************************************************
11148 //******************************************************************************
11149 /* Function:
11150  uint16_t PLIB_DMA_ChannelXSourceSizeGet ( DMA_MODULE_ID index,
11151  DMA_CHANNEL dmaChannel )
11152  Summary:
11153  Reads the source size configured for the specified channel.
11154  Description:
11155  This function reads the source size configured for the specified
11156  channel.
11157  Precondition:
11158  None.
11159  Parameters:
11160  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11161  Returns:
11162  - uint16_t - The Source size configured (in bytes) for this channel.
11163  The source size (8-bit, 16-bit) is device-specific. Please refer to the specific
11164  device data sheet to determine availability.
11165  Example:
11166  <code>
11167  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11168  uint16_t sourceSize;
11169  sourceSize = PLIB_DMA_ChannelXSourceSizeGet ( DMA_ID_0,
11170  spiDMAChannel );
11171  </code>
11172  Remarks:
11173  This function implements an operation of the ChannelXSourceSize feature.
11174  This feature may not be available on all devices. Please refer to the
11175  specific device data sheet to determine availability or use the
11176  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11177  determine whether this feature is available.
11178 */
11179 
11180 uint16_t
11182  DMA_MODULE_ID index ,
11183  DMA_CHANNEL dmaChannel ) ;
11184 //******************************************************************************
11185 /* Function:
11186  void PLIB_DMA_ChannelXSourceSizeSet ( DMA_MODULE_ID index,
11187  DMA_CHANNEL dmaChannel,
11188  uint16_t sourceSize)
11189  Summary:
11190  Writes the specified source size into the register corresponding
11191  to the specified channel.
11192  Description:
11193  This function writes the specified source size into the register
11194  corresponding to the specified channel.
11195  Precondition:
11196  None.
11197  Parameters:
11198  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11199  sourceSize - The source size. The source size (8-bit, 16-bit) is
11200  device-specific. Please refer to the specific device data
11201  sheet to determine availability.
11202  Returns:
11203  None.
11204  Example:
11205  <code>
11206  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11207  uint16_t sourceSize = 0xA00;
11208  PLIB_DMA_ChannelXSourceSizeSet ( DMA_ID_0,
11209  spiDMAChannel,
11210  sourceSize );
11211  </code>
11212  Remarks:
11213  This function implements an operation of the ChannelXSourceSize feature.
11214  This feature may not be available on all devices. Please refer to the
11215  specific device data sheet to determine availability or use the
11216  PLIB_DMA_ExistsChannelXSourceSize function in your application to automatically
11217  determine whether this feature is available.
11218 */
11219 
11220 void
11222  DMA_MODULE_ID index ,
11223  DMA_CHANNEL dmaChannel ,
11224  uint16_t sourceSize ) ;
11225 //******************************************************************************
11226 /* Function:
11227  uint16_t PLIB_DMA_ChannelXDestinationSizeGet ( DMA_MODULE_ID index,
11228  DMA_CHANNEL dmaChannel )
11229  Summary:
11230  Reads the destination size configured for the specified channel.
11231  Description:
11232  This function reads the destination size configured for the specified
11233  channel.
11234  Precondition:
11235  None.
11236  Parameters:
11237  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11238  Returns:
11239  - uint16_t - The destination size configured (in bytes) for this channel.
11240  The destination size (8-bit, 16-bit) is device-specific. Please refer to the specific
11241  device data sheet to determine availability.
11242  Example:
11243  <code>
11244  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11245  uint16_t DestinationSize;
11246  DestinationSize = PLIB_DMA_ChannelXDestinationSizeGet ( DMA_ID_0,
11247  spiDMAChannel );
11248  </code>
11249  Remarks:
11250  This function implements an operation of the ChannelXDestinationSize feature.
11251  This feature may not be available on all devices. Please refer to the
11252  specific device data sheet to determine availability or use the
11253  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11254  determine whether this feature is available.
11255 */
11256 
11257 uint16_t
11259  DMA_MODULE_ID index ,
11260  DMA_CHANNEL dmaChannel ) ;
11261 //******************************************************************************
11262 /* Function:
11263  void PLIB_DMA_ChannelXDestinationSizeSet ( DMA_MODULE_ID index,
11264  DMA_CHANNEL dmaChannel,
11265  uint16_t destinationSize)
11266  Summary:
11267  Writes the specified destination size into the register corresponding
11268  to the specified channel.
11269  Description:
11270  This function writes the specified destination size into the register
11271  corresponding to the specified channel.
11272  Precondition:
11273  None.
11274  Parameters:
11275  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11276  destinationSize - The destination size. The destination size (8-bit, 16-bit)
11277  is device-specific. Please refer to the specific device
11278  data sheet to determine availability.)
11279  Returns:
11280  None.
11281  Example:
11282  <code>
11283  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11284  uint16_t destinationSize = 0xA00;
11285  PLIB_DMA_ChannelXDestinationSizeSet( DMA_ID_0, spiDMAChannel, destinationSize );
11286  </code>
11287  Remarks:
11288  This function implements an operation of the ChannelXDestinationSize feature.
11289  This feature may not be available on all devices. Please refer to the
11290  specific device data sheet to determine availability or use the
11291  PLIB_DMA_ExistsChannelXDestinationSize function in your application to automatically
11292  determine whether this feature is available.
11293 */
11294 
11295 void
11297  DMA_MODULE_ID index ,
11298  DMA_CHANNEL dmaChannel ,
11299  uint16_t destinationSize ) ;
11300 //******************************************************************************
11301 /* Function:
11302  uint16_t PLIB_DMA_ChannelXSourcePointerGet ( DMA_MODULE_ID index,
11303  DMA_CHANNEL dmaChannel )
11304  Summary:
11305  Reads the current byte of the source being pointed to for the specified channel.
11306  Description:
11307  This function reads the current byte of the source being pointed to for the
11308  specified channel.
11309  Precondition:
11310  None.
11311  Parameters:
11312  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11313  Returns:
11314  - uint16_t - The source byte being pointed to for this channel.
11315  The source pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11316  device data sheet to determine availability.
11317  Example:
11318  <code>
11319  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11320  uint16_t sourcebyte;
11321  sourcebyte = PLIB_DMA_ChannelXSourcePointerGet ( DMA_ID_0, spiDMAChannel );
11322  </code>
11323  Remarks:
11324  This function implements an operation of the ChannelXSourcePointer feature.
11325  This feature may not be available on all devices. Please refer to the
11326  specific device data sheet to determine availability or use the
11327  PLIB_DMA_ExistsChannelXSourcePointer function in your application to automatically
11328  determine whether this feature is available.
11329 */
11330 
11331 uint16_t
11333  DMA_MODULE_ID index ,
11334  DMA_CHANNEL dmaChannel ) ;
11335 //******************************************************************************
11336 /* Function:
11337  uint16_t PLIB_DMA_ChannelXDestinationPointerGet ( DMA_MODULE_ID index,
11338  DMA_CHANNEL dmaChannel )
11339  Summary:
11340  Reads the current byte of the destination being pointed to for the specified channel.
11341  Description:
11342  This function reads the current byte of the destination being pointed to for the
11343  specified channel.
11344  Precondition:
11345  None.
11346  Parameters:
11347  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11348  Returns:
11349  - uint16_t - The destination byte being pointed to for this channel.
11350  The destination pointer (8-bit, 16-bit) is device-specific. Please refer to the specific
11351  device data sheet to determine availability.
11352  Example:
11353  <code>
11354  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11355  uint16_t destinationbyte;
11356  destinationbyte = PLIB_DMA_ChannelXDestinationPointerGet ( DMA_ID_0,
11357  spiDMAChannel );
11358  </code>
11359  Remarks:
11360  This function implements an operation of the ChannelXDestinationPointer feature.
11361  This feature may not be available on all devices. Please refer to the
11362  specific device data sheet to determine availability or use the
11363  PLIB_DMA_ExistsChannelXDestinationPointer function in your application to automatically
11364  determine whether this feature is available.
11365 */
11366 
11367 uint16_t
11369  DMA_MODULE_ID index ,
11370  DMA_CHANNEL dmaChannel ) ;
11371 //******************************************************************************
11372 /* Function:
11373  uint16_t PLIB_DMA_ChannelXCellSizeGet ( DMA_MODULE_ID index,
11374  DMA_CHANNEL dmaChannel )
11375  Summary:
11376  Reads the cell size (in bytes) configured for the specified channel.
11377  Description:
11378  This function reads the cell size (in bytes) configured for the specified
11379  channel.
11380  Precondition:
11381  None.
11382  Parameters:
11383  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11384  Returns:
11385  - uint16_t - The cell size configured (in bytes) for this channel
11386  The cell size (8-bit, 16-bit) is device-specific. Please refer to the specific
11387  device data sheet to determine availability.
11388  Example:
11389  <code>
11390  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11391  uint16_t cellSize;
11392  cellSize = PLIB_DMA_ChannelXCellSizeGet ( DMA_ID_0,
11393  spiDMAChannel );
11394  </code>
11395  Remarks:
11396  This function implements an operation of the ChannelXCellSize feature.
11397  This feature may not be available on all devices. Please refer to the
11398  specific device data sheet to determine availability or use the
11399  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11400  determine whether this feature is available.
11401 */
11402 
11403 uint16_t
11405  DMA_MODULE_ID index ,
11406  DMA_CHANNEL dmaChannel ) ;
11407 //******************************************************************************
11408 /* Function:
11409  void PLIB_DMA_ChannelXCellSizeSet ( DMA_MODULE_ID index,
11410  DMA_CHANNEL dmaChannel,
11411  uint16_t cellSize)
11412  Summary:
11413  Writes the specified cell size into the register corresponding
11414  to the specified channel.
11415  Description:
11416  This function writes the specified cell size into the register
11417  corresponding to the specified channel.
11418  Precondition:
11419  None.
11420  Parameters:
11421  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11422  cellSize - The cell size in bytes. The cell size (8-bit, 16-bit) is
11423  device-specific. Please refer to the specific device data
11424  sheet to determine availability.)
11425  Returns:
11426  None.
11427  Example:
11428  <code>
11429  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11430  uint16_t cellSize = 0x10;
11431  PLIB_DMA_ChannelXCellSizeSet ( DMA_ID_0, spiDMAChannel, cellSize );
11432  </code>
11433  Remarks:
11434  This function implements an operation of the ChannelXCellSize feature.
11435  This feature may not be available on all devices. Please refer to the
11436  specific device data sheet to determine availability or use the
11437  PLIB_DMA_ExistsChannelXCellSize function in your application to automatically
11438  determine whether this feature is available.
11439 */
11440 
11441 void
11443  DMA_MODULE_ID index ,
11444  DMA_CHANNEL dmaChannel ,
11445  uint16_t CellSize ) ;
11446 //******************************************************************************
11447 /* Function:
11448  uint16_t PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_MODULE_ID index,
11449  DMA_CHANNEL dmaChannel )
11450  Summary:
11451  Returns the number of bytes transferred since the last event.
11452  Description:
11453  This function returns the number of bytes transferred since the last event.
11454  Precondition:
11455  None.
11456  Parameters:
11457  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11458  Returns:
11459  - uint16_t - The number of bytes transferred since the last event.
11460  The cell progress pointer (8-bit, 16-bit) is device-specific. Please refer to
11461  the specific device data sheet to determine availability.
11462  Example:
11463  <code>
11464  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11465  uint16_t CellProgress;
11466  CellProgress = PLIB_DMA_ChannelXCellProgressPointerGet ( DMA_ID_0,
11467  spiDMAChannel );
11468  </code>
11469  Remarks:
11470  This function implements an operation of the ChannelXCellProgressPointer feature.
11471  This feature may not be available on all devices. Please refer to the
11472  specific device data sheet to determine availability or use the
11473  PLIB_DMA_ExistsChannelXCellProgressPointer function in your application to automatically
11474  determine whether this feature is available.
11475 */
11476 
11477 uint16_t
11479  DMA_MODULE_ID index ,
11480  DMA_CHANNEL dmaChannel ) ;
11481 //******************************************************************************
11482 /* Function:
11483  uint16_t PLIB_DMA_ChannelXPatternDataGet ( DMA_MODULE_ID index,
11484  DMA_CHANNEL dmaChannel )
11485  Summary:
11486  Returns the pattern matching (for DMA abort) data programmed for the specified
11487  channel.
11488  Description:
11489  This function returns pattern matching (for DMA abort) data programmed for
11490  the specified channel.
11491  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11492  the specific device data sheet to determine availability.)
11493  Precondition:
11494  None.
11495  Parameters:
11496  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11497  Returns:
11498  - uint16_t - The pattern matching data programmed for the current channel.
11499  The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11500  the specific device data sheet to determine availability.
11501  Example:
11502  <code>
11503  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11504  uint16_t patternData;
11505  patternData = PLIB_DMA_ChannelXPatternDataGet ( DMA_ID_0, spiDMAChannel );
11506  </code>
11507  Remarks:
11508  This function implements an operation of the ChannelXPatternData feature.
11509  This feature may not be available on all devices. Please refer to the
11510  specific device data sheet to determine availability or use the
11511  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11512  determine whether this feature is available.
11513 */
11514 
11515 uint16_t
11517  DMA_MODULE_ID index ,
11518  DMA_CHANNEL dmaChannel ) ;
11519 //******************************************************************************
11520 /* Function:
11521  void PLIB_DMA_ChannelXPatternDataSet ( DMA_MODULE_ID index,
11522  DMA_CHANNEL dmaChannel,
11523  uint16_t patternData)
11524  Summary:
11525  Writes the specified pattern matching data (for DMA abort) into the register
11526  corresponding to the specified channel.
11527  Description:
11528  This function writes the specified pattern matching data (for DMA abort) into the
11529  register corresponding to the specified channel.
11530  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11531  the specific device data sheet to determine availability.)
11532  Precondition:
11533  None.
11534  Parameters:
11535  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11536  patternData - The pattern matching DATA programmed for the current channel
11537  (The size of pattern matching data(8-bit, 16-bit) is device-specific. Please refer to
11538  the specific device data sheet to determine availability.)
11539  Returns:
11540  None.
11541  Example:
11542  <code>
11543  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11544  uint16_t patternData = '\0';
11545  PLIB_DMA_ChannelXPatternDataSet ( DMA_ID_0, spiDMAChannel, patternData );
11546  </code>
11547  Remarks:
11548  This function implements an operation of the ChannelXPatternData feature.
11549  This feature may not be available on all devices. Please refer to the
11550  specific device data sheet to determine availability or use the
11551  PLIB_DMA_ExistsChannelXPatternData function in your application to automatically
11552  determine whether this feature is available.
11553 */
11554 
11555 void
11557  DMA_MODULE_ID index ,
11558  DMA_CHANNEL dmaChannel ,
11559  uint16_t patternData ) ;
11560 // *****************************************************************************
11561 // *****************************************************************************
11562 // Section: DMA Interrupt Control Interface functions
11563 // *****************************************************************************
11564 // *****************************************************************************
11565 //******************************************************************************
11566 /* Function:
11567  bool PLIB_DMA_ChannelXINTSourceFlagGet ( DMA_MODULE_ID index,
11568  DMA_CHANNEL dmaChannel,
11569  DMA_INT_TYPE dmaINTSource )
11570  Summary:
11571  Returns the status of the interrupt flag of the specified DMA interrupt source
11572  for the specified channel.
11573  Description:
11574  This function returns the status of the interrupt flag of the specified DMA interrupt
11575  source for the specified channel.
11576  Precondition:
11577  None.
11578  Parameters:
11579  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11580  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11581  Returns:
11582  - true - The interrupt flag is set
11583  - false - The interrupt flag is not set
11584  Example:
11585  <code>
11586  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11587  bool AddressErrorINTStatus;
11588  AddressErrorINTStatus = PLIB_DMA_ChannelXINTSourceFlagGet (
11589  DMA_ID_0,
11590  spiDMAChannel,
11591  DMA_INT_ADDRESS_ERROR );
11592  </code>
11593  Remarks:
11594  This function implements an operation of the ChannelXINTSourceFlag feature.
11595  This feature may not be available on all devices. Please refer to the
11596  specific device data sheet to determine availability or use the
11597  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11598  determine whether this feature is available.
11599 */
11600 
11601 bool
11603  DMA_MODULE_ID index ,
11604  DMA_CHANNEL dmaChannel ,
11605  DMA_INT_TYPE dmaINTSource ) ;
11606 //******************************************************************************
11607 /* Function:
11608  void PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_MODULE_ID index,
11609  DMA_CHANNEL dmaChannel,
11610  DMA_INT_TYPE dmaINTSource )
11611  Summary:
11612  Sets the interrupt flag of the specified DMA interrupt source for the specified channel.
11613  Description:
11614  This function sets the interrupt flag of the specified DMA interrupt source for
11615  the specified channel.
11616  Precondition:
11617  None.
11618  Parameters:
11619  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11620  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11621  Returns:
11622  None.
11623  Example:
11624  <code>
11625  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11626  PLIB_DMA_ChannelXINTSourceFlagSet ( DMA_ID_0,
11627  spiDMAChannel,
11628  DMA_INT_ADDRESS_ERROR );
11629  </code>
11630  Remarks:
11631  This function implements an operation of the ChannelXINTSourceFlag feature.
11632  This feature may not be available on all devices. Please refer to the
11633  specific device data sheet to determine availability or use the
11634  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11635  determine whether this feature is available.
11636 */
11637 
11638 void
11640  DMA_MODULE_ID index ,
11641  DMA_CHANNEL dmaChannel ,
11642  DMA_INT_TYPE dmaINTSource ) ;
11643 //******************************************************************************
11644 /* Function:
11645  void PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_MODULE_ID index,
11646  DMA_CHANNEL dmaChannel,
11647  DMA_INT_TYPE dmaINTSource )
11648  Summary:
11649  Clears the interrupt flag of the specified DMA interrupt source
11650  for the specified channel.
11651  Description:
11652  This function clears the interrupt flag of the specified DMA interrupt source
11653  for the specified channel.
11654  Precondition:
11655  None.
11656  Parameters:
11657  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11658  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11659  Returns:
11660  None.
11661  Example:
11662  <code>
11663  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11664  PLIB_DMA_ChannelXINTSourceFlagClear ( DMA_ID_0,
11665  spiDMAChannel,
11666  DMA_INT_ADDRESS_ERROR );
11667  </code>
11668  Remarks:
11669  This function implements an operation of the ChannelXINTSourceFlag feature.
11670  This feature may not be available on all devices. Please refer to the
11671  specific device data sheet to determine availability or use the
11672  PLIB_DMA_ExistsChannelXINTSourceFlag function in your application to automatically
11673  determine whether this feature is available.
11674 */
11675 
11676 void
11678  DMA_MODULE_ID index ,
11679  DMA_CHANNEL dmaChannel ,
11680  DMA_INT_TYPE dmaINTSource ) ;
11681 //******************************************************************************
11682 /* Function:
11683  void PLIB_DMA_ChannelXINTSourceEnable ( DMA_MODULE_ID index,
11684  DMA_CHANNEL dmaChannel,
11685  DMA_INT_TYPE dmaINTSource )
11686  Summary:
11687  Enables the specified interrupt source for the specified channel.
11688  Description:
11689  This function enables the specified interrupt source for the specified channel.
11690  Precondition:
11691  None.
11692  Parameters:
11693  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11694  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11695  Returns:
11696  None.
11697  Example:
11698  <code>
11699  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11700  PLIB_DMA_ChannelXINTSourceEnable ( DMA_ID_0,
11701  spiDMAChannel,
11702  DMA_INT_ADDRESS_ERROR );
11703  </code>
11704  Remarks:
11705  This function implements an operation of the ChannelXINTSource feature.
11706  This feature may not be available on all devices. Please refer to the
11707  specific device data sheet to determine availability or use the
11708  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11709  determine whether this feature is available.
11710 */
11711 
11712 void
11714  DMA_MODULE_ID index ,
11715  DMA_CHANNEL dmaChannel ,
11716  DMA_INT_TYPE dmaINTSource ) ;
11717 //******************************************************************************
11718 /* Function:
11719  void PLIB_DMA_ChannelXINTSourceDisable ( DMA_MODULE_ID index,
11720  DMA_CHANNEL dmaChannel,
11721  DMA_INT_TYPE dmaINTSource )
11722  Summary:
11723  Disables the specified interrupt source for the specified channel.
11724  Description:
11725  This function disables the specified interrupt source for the specified channel.
11726  Precondition:
11727  None.
11728  Parameters:
11729  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11730  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11731  Returns:
11732  None.
11733  Example:
11734  <code>
11735  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11736  PLIB_DMA_ChannelXINTSourceDisable ( DMA_ID_0,
11737  spiDMAChannel,
11738  DMA_INT_ADDRESS_ERROR );
11739  </code>
11740  Remarks:
11741  This function implements an operation of the ChannelXINTSource feature.
11742  This feature may not be available on all devices. Please refer to the
11743  specific device data sheet to determine availability or use the
11744  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11745  determine whether this feature is available.
11746 */
11747 
11748 void
11750  DMA_MODULE_ID index ,
11751  DMA_CHANNEL dmaChannel ,
11752  DMA_INT_TYPE dmaINTSource ) ;
11753 //******************************************************************************
11754 /* Function:
11755  bool PLIB_DMA_ChannelXINTSourceIsEnabled ( DMA_MODULE_ID index,
11756  DMA_CHANNEL dmaChannel,
11757  DMA_INT_TYPE dmaINTSource )
11758  Summary:
11759  Returns the enable status of the specified interrupt source for the specified channel.
11760  Description:
11761  This function returns the enable status of the specified interrupt source for the
11762  specified channel.
11763  Precondition:
11764  None.
11765  Parameters:
11766  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11767  dmaINTSource - One of the DMA interrupt sources specified by DMA_INT_TYPE
11768  Returns:
11769  - true - The interrupt is enabled
11770  - false - The interrupt is not enabled
11771  Example:
11772  <code>
11773  DMA_CHANNEL spiDMAChannel = DMA_CHANNEL_2;
11774  bool dmaINTSourceEnableStatus;
11775  dmaINTSourceEnableStatus = PLIB_DMA_ChannelXINTSourceIsEnabled (
11776  DMA_ID_0,
11777  spiDMAChannel,
11778  DMA_INT_ADDRESS_ERROR );
11779  </code>
11780  Remarks:
11781  This function implements an operation of the ChannelXINTSource feature.
11782  This feature may not be available on all devices. Please refer to the
11783  specific device data sheet to determine availability or use the
11784  PLIB_DMA_ExistsChannelXINTSource function in your application to automatically
11785  determine whether this feature is available.
11786 */
11787 
11788 bool
11790  DMA_MODULE_ID index ,
11791  DMA_CHANNEL dmaChannel ,
11792  DMA_INT_TYPE dmaINTSource ) ;
11793 //******************************************************************************
11794 /* Function:
11795  void PLIB_DMA_ChannelXPatternLengthSet( DMA_MODULE_ID index,
11796  DMA_CHANNEL dmaChannel,DMA_PATTERN_LENGTH patternLen )
11797  Summary:
11798  Sets the pattern match length.
11799  Description:
11800  This function sets the length of the pattern match ignore to 1 or 2 bytes.
11801  Precondition:
11802  None.
11803  Parameters:
11804  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11805  patternLen - Length of pattern match (either 1 or 2)
11806  Returns:
11807  None.
11808  Example:
11809  <code>
11810  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11811  DMA_PATTERN_LENGTH patternLen;
11812  patternLen = DMA_PATTERN_MATCH_LENGTH_1BYTE;
11813  PLIB_DMA_ChannelXPatternLengthSet(DMA_ID_0, dmaChannel, patternLen);
11814  </code>
11815  Remarks:
11816  This function implements an operation of the ChannelXPatternLength feature.
11817  This feature may not be available on all devices. Please refer to the
11818  specific device data sheet to determine availability or use the
11819  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11820  determine whether this feature is available.
11821 */
11822 
11823 void
11825  DMA_MODULE_ID index ,
11826  DMA_CHANNEL dmaChannel ,
11827  DMA_PATTERN_LENGTH patternLen ) ;
11828 //******************************************************************************
11829 /* Function:
11830  DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet( DMA_MODULE_ID index,
11831  DMA_CHANNEL dmaChannel);
11832  Summary:
11833  Returns the pattern match length.
11834  Description:
11835  This function returns the length of the byte matching the CHPIGN bits during a
11836  pattern match that may be ignored during the pattern match determination when
11837  the CHPIGNEN bit is set.
11838  Precondition:
11839  None.
11840  Parameters:
11841  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11842  Returns:
11843  - patternLen - Length of pattern match (either 1 or 2)
11844  Example:
11845  <code>
11846  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11847  DMA_PATTERN_LENGTH patternLen;
11848  patternLen = PLIB_DMA_ChannelXPatternLengthGet(DMA_ID_0, dmaChannel);
11849  </code>
11850  Remarks:
11851  This function implements an operation of the ChannelXPatternLength feature.
11852  This feature may not be available on all devices. Please refer to the
11853  specific device data sheet to determine availability or use the
11854  PLIB_DMA_ExistsChannelXPatternLength function in your application to automatically
11855  determine whether this feature is available.
11856 */
11857 
11858 DMA_PATTERN_LENGTH
11860  DMA_MODULE_ID index ,
11861  DMA_CHANNEL dmaChannel ) ;
11862 //******************************************************************************
11863 /* Function:
11864  void PLIB_DMA_ChannelXPatternIgnoreByteEnable ( DMA_MODULE_ID index,
11865  DMA_CHANNEL channel );
11866  Summary:
11867  Enables the pattern match ignore byte.
11868  Description:
11869  This function enables the pattern match ignore byte.
11870  Precondition:
11871  None.
11872  Parameters:
11873  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11874  Returns:
11875  None.
11876  Example:
11877  <code>
11878  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11879  PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_ID_0, dmaChannel);
11880  </code>
11881  Remarks:
11882  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11883  This feature may not be available on all devices. Please refer to the
11884  specific device data sheet to determine availability or use the
11885  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11886  determine whether this feature is available.
11887 */
11888 
11889 void
11891  DMA_MODULE_ID index ,
11892  DMA_CHANNEL channel ) ;
11893 //******************************************************************************
11894 /* Function:
11895  bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled ( DMA_MODULE_ID index,
11896  DMA_CHANNEL channel );
11897  Summary:
11898  Returns the state of the pattern match ignore byte.
11899  Description:
11900  This function returns the state (enabled or disabled) of the pattern match
11901  ignore byte.
11902  Precondition:
11903  None.
11904  Parameters:
11905  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11906  Returns:
11907  - true - The pattern match ignore byte is enabled
11908  - false - The pattern match ignore byte is disabled
11909  Example:
11910  <code>
11911  bool patternIsEnabled;
11912  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11913  patternIsEnabled = PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_ID_0, dmaChannel);
11914  </code>
11915  Remarks:
11916  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11917  This feature may not be available on all devices. Please refer to the
11918  specific device data sheet to determine availability or use the
11919  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11920  determine whether this feature is available.
11921 */
11922 
11923 bool
11925  DMA_MODULE_ID index ,
11926  DMA_CHANNEL channel ) ;
11927 //******************************************************************************
11928 /* Function:
11929  void PLIB_DMA_ChannelXPatternIgnoreByteDisable ( DMA_MODULE_ID index,
11930  DMA_CHANNEL channel );
11931  Summary:
11932  Disables the pattern match ignore byte.
11933  Description:
11934  This function disables the pattern match ignore byte.
11935  Precondition:
11936  None.
11937  Parameters:
11938  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11939  Returns:
11940  None.
11941  Example:
11942  <code>
11943  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11944  PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_ID_0, dmaChannel);
11945  </code>
11946  Remarks:
11947  This function implements an operation of the ChannelXPatternIgnoreByte feature.
11948  This feature may not be available on all devices. Please refer to the
11949  specific device data sheet to determine availability or use the
11950  PLIB_DMA_ExistsChannelXPatternIgnoreByte function in your application to automatically
11951  determine whether this feature is available.
11952 */
11953 
11954 void
11956  DMA_MODULE_ID index ,
11957  DMA_CHANNEL channel ) ;
11958 //******************************************************************************
11959 /* Function:
11960  void PLIB_DMA_ChannelXPatternIgnoreSet (DMA_MODULE_ID index,
11961  DMA_CHANNEL channel, uint8_t pattern );
11962  Summary:
11963  Sets the pattern match ignore value.
11964  Description:
11965  This function sets the value of the pattern match ignore.
11966  Precondition:
11967  None.
11968  Parameters:
11969  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
11970  pattern - Pattern match ignore value
11971  Returns:
11972  None.
11973  Example:
11974  <code>
11975  uint8_t patternMatch = 0x8;
11976  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
11977  PLIB_DMA_ChannelXPatternIgnoreSet ( DMA_ID_0, dmaChannel,patternMatch);
11978  </code>
11979  Remarks:
11980  This function implements an operation of the ChannelXPatternIgnore feature.
11981  This feature may not be available on all devices. Please refer to the
11982  specific device data sheet to determine availability or use the
11983  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
11984  determine whether this feature is available.
11985 */
11986 
11987 void
11989  DMA_MODULE_ID index ,
11990  DMA_CHANNEL channel ,
11991  uint8_t pattern ) ;
11992 //******************************************************************************
11993 /* Function:
11994  uint8_t PLIB_DMA_ChannelXPatternIgnoreGet( DMA_MODULE_ID index,
11995  DMA_CHANNEL channel );
11996  Summary:
11997  Returns the pattern match ignore value.
11998  Description:
11999  This function returns the value of the pattern match ignore.
12000  Precondition:
12001  None.
12002  Parameters:
12003  dmaChannel - One of the possible DMA channels listed by DMA_CHANNEL
12004  Returns:
12005  - uint8_t - Pattern match ignore value
12006  Example:
12007  <code>
12008  uint8_t patternMatch;
12009  DMA_CHANNEL dmaChannel = DMA_CHANNEL_2;
12010  patternMatch = PLIB_DMA_ChannelXPatternIgnoreGet ( DMA_ID_0, dmaChannel);
12011  </code>
12012  Remarks:
12013  This function implements an operation of the ChannelXPatternIgnore feature.
12014  This feature may not be available on all devices. Please refer to the
12015  specific device data sheet to determine availability or use the
12016  PLIB_DMA_ExistsChannelXPatternIgnore function in your application to automatically
12017  determine whether this feature is available.
12018 */
12019 
12020 uint8_t
12022  DMA_MODULE_ID index ,
12023  DMA_CHANNEL channel ) ;
12024 // *****************************************************************************
12025 // *****************************************************************************
12026 // Section: DMA Peripheral Library Exists API Routines
12027 // *****************************************************************************
12028 // *****************************************************************************
12029 /* The following functions indicate the existence of the features on the device.
12030 */
12031 //******************************************************************************
12032 /* Function : PLIB_DMA_ExistsBusy( DMA_MODULE_ID index )
12033  Summary:
12034  Identifies whether the Busy feature exists on the DMA module.
12035  Description:
12036  This function identifies whether the Busy feature is available on the
12037  DMA module.
12038  When this function returns true, these functions are supported on the device:
12039  - PLIB_DMA_BusyActiveSet
12040  - PLIB_DMA_BusyActiveReset
12041  - PLIB_DMA_IsBusy
12042  Preconditions:
12043  None.
12044  Parameters:
12045  index - Identifier for the device instance
12046  Returns:
12047  - true - The Busy feature is supported on the device
12048  - false - The Busy feature is not supported on the device
12049  Remarks:
12050  None.
12051 */
12052 
12053 bool
12055  DMA_MODULE_ID index ) ;
12056 //******************************************************************************
12057 /* Function : PLIB_DMA_ExistsSuspend( DMA_MODULE_ID index )
12058  Summary:
12059  Identifies whether the Suspend feature exists on the DMA module.
12060  Description:
12061  This function identifies whether the Suspend feature is available on the
12062  DMA module.
12063  When this function returns true, these functions are supported on the device:
12064  - PLIB_DMA_SuspendEnable
12065  - PLIB_DMA_SuspendDisable
12066  - PLIB_DMA_SuspendIsEnabled
12067  Preconditions:
12068  None.
12069  Parameters:
12070  index - Identifier for the device instance
12071  Returns:
12072  - true - The Suspend feature is supported on the device
12073  - false - The Suspend feature is not supported on the device
12074  Remarks:
12075  None.
12076 */
12077 
12078 bool
12080  DMA_MODULE_ID index ) ;
12081 //******************************************************************************
12082 /* Function : PLIB_DMA_ExistsStopInIdle( DMA_MODULE_ID index )
12083  Summary:
12084  Identifies whether the StopInIdle feature exists on the DMA module.
12085  Description:
12086  This function identifies whether the StopInIdle feature is available on the
12087  DMA module.
12088  When this function returns true, these functions are supported on the device:
12089  - PLIB_DMA_StopInIdleEnable
12090  - PLIB_DMA_StopInIdleDisable
12091  Preconditions:
12092  None.
12093  Parameters:
12094  index - Identifier for the device instance
12095  Returns:
12096  - true - The StopInIdle feature is supported on the device
12097  - false - The StopInIdle feature is not supported on the device
12098  Remarks:
12099  None.
12100 */
12101 
12102 bool
12104  DMA_MODULE_ID index ) ;
12105 //******************************************************************************
12106 /* Function : PLIB_DMA_ExistsEnableControl( DMA_MODULE_ID index )
12107  Summary:
12108  Identifies whether the EnableControl feature exists on the DMA module.
12109  Description:
12110  This function identifies whether the EnableControl feature is available on
12111  the DMA module.
12112  When this function returns true, these functions are supported on the device:
12113  - PLIB_DMA_Enable
12114  - PLIB_DMA_Disable
12115  - PLIB_DMA_IsEnabled
12116  Preconditions:
12117  None.
12118  Parameters:
12119  index - Identifier for the device instance
12120  Returns:
12121  - true - The EnableControl feature is supported on the device
12122  - false - The EnableControl feature is not supported on the device
12123  Remarks:
12124  None.
12125 */
12126 
12127 bool
12129  DMA_MODULE_ID index ) ;
12130 //******************************************************************************
12131 /* Function : PLIB_DMA_ExistsChannelBits( DMA_MODULE_ID index )
12132  Summary:
12133  Identifies whether the ChannelBits feature exists on the DMA module.
12134  Description:
12135  This function identifies whether the ChannelBits feature is available on the
12136  DMA module.
12137  When this function returns true, this function is supported on the device:
12138  - PLIB_DMA_ChannelBitsGet
12139  Preconditions:
12140  None.
12141  Parameters:
12142  index - Identifier for the device instance
12143  Returns:
12144  - true - The ChannelBits feature is supported on the device
12145  - false - The ChannelBits feature is not supported on the device
12146  Remarks:
12147  None.
12148 */
12149 
12150 bool
12152  DMA_MODULE_ID index ) ;
12153 //******************************************************************************
12154 /* Function : PLIB_DMA_ExistsLastBusAccess( DMA_MODULE_ID index )
12155  Summary:
12156  Identifies whether the LastBusAccess feature exists on the DMA module.
12157  Description:
12158  This function identifies whether the LastBusAccess feature is available on the
12159  DMA module.
12160  When this function returns true, these functions are supported on the device:
12161  - PLIB_DMA_LastBusAccessIsRead
12162  - PLIB_DMA_LastBusAccessIsWrite
12163  Preconditions:
12164  None.
12165  Parameters:
12166  index - Identifier for the device instance
12167  Returns:
12168  - true - The LastBusAccess feature is supported on the device
12169  - false - The LastBusAccess feature is not supported on the device
12170  Remarks:
12171  None.
12172 */
12173 
12174 bool
12176  DMA_MODULE_ID index ) ;
12177 //******************************************************************************
12178 /* Function : PLIB_DMA_ExistsRecentAddress( DMA_MODULE_ID index )
12179  Summary:
12180  Identifies whether the RecentAddress feature exists on the DMA module.
12181  Description:
12182  This function identifies whether the RecentAddress feature is available on
12183  the DMA module.
12184  When this function returns true, this function is supported on the device:
12185  - PLIB_DMA_RecentAddressAccessed
12186  Preconditions:
12187  None.
12188  Parameters:
12189  index - Identifier for the device instance
12190  Returns:
12191  - true - The RecentAddress feature is supported on the device
12192  - false - The RecentAddress feature is not supported on the device
12193  Remarks:
12194  None.
12195 */
12196 
12197 bool
12199  DMA_MODULE_ID index ) ;
12200 //******************************************************************************
12201 /* Function : PLIB_DMA_ExistsCRCChannel( DMA_MODULE_ID index )
12202  Summary:
12203  Identifies whether the CRCChannel feature exists on the DMA module.
12204  Description:
12205  This function identifies whether the CRCChannel feature is available on the
12206  DMA module.
12207  When this function returns true, these functions are supported on the device:
12208  - PLIB_DMA_CRCChannelSelect
12209  - PLIB_DMA_CRCChannelGet
12210  Preconditions:
12211  None.
12212  Parameters:
12213  index - Identifier for the device instance
12214  Returns:
12215  - true - The CRCChannel feature is supported on the device
12216  - false - The CRCChannel feature is not supported on the device
12217  Remarks:
12218  None.
12219 */
12220 
12221 bool
12223  DMA_MODULE_ID index ) ;
12224 //******************************************************************************
12225 /* Function : PLIB_DMA_ExistsCRCType( DMA_MODULE_ID index )
12226  Summary:
12227  Identifies whether the CRCType feature exists on the DMA module.
12228  Description:
12229  This function identifies whether the CRCType feature is available on the
12230  DMA module.
12231  When this function returns true, these functions are supported on the device:
12232  - PLIB_DMA_CRCTypeGet
12233  - PLIB_DMA_CRCTypeSet
12234  Preconditions:
12235  None.
12236  Parameters:
12237  index - Identifier for the device instance
12238  Returns:
12239  - true - The CRCType feature is supported on the device
12240  - false - The CRCType feature is not supported on the device
12241  Remarks:
12242  None.
12243 */
12244 
12245 bool
12247  DMA_MODULE_ID index ) ;
12248 //******************************************************************************
12249 /* Function : PLIB_DMA_ExistsCRCAppendMode( DMA_MODULE_ID index )
12250  Summary:
12251  Identifies whether the CRCAppendMode feature exists on the DMA module.
12252  Description:
12253  This function identifies whether the CRCAppendMode feature is available on
12254  the DMA module.
12255  When this function returns true, these functions are supported on the device:
12256  - PLIB_DMA_CRCAppendModeEnable
12257  - PLIB_DMA_CRCAppendModeDisable
12258  - PLIB_DMA_CRCAppendModeIsEnabled
12259  Preconditions:
12260  None.
12261  Parameters:
12262  index - Identifier for the device instance
12263  Returns:
12264  - true - The CRCAppendMode feature is supported on the device
12265  - false - The CRCAppendMode feature is not supported on the device
12266  Remarks:
12267  None.
12268 */
12269 
12270 bool
12272  DMA_MODULE_ID index ) ;
12273 //******************************************************************************
12274 /* Function : PLIB_DMA_ExistsCRC( DMA_MODULE_ID index )
12275  Summary:
12276  Identifies whether the CRC feature exists on the DMA module.
12277  Description:
12278  This function identifies whether the CRC feature is available on the DMA module.
12279  When this function returns true, these functions are supported on the device:
12280  - PLIB_DMA_CRCEnable
12281  - PLIB_DMA_CRCDisable
12282  - PLIB_DMA_CRCIsEnabled
12283  Preconditions:
12284  None.
12285  Parameters:
12286  index - Identifier for the device instance
12287  Returns:
12288  - true - The CRC feature is supported on the device
12289  - false - The CRC feature is not supported on the device
12290  Remarks:
12291  None.
12292 */
12293 
12294 bool
12296  DMA_MODULE_ID index ) ;
12297 //******************************************************************************
12298 /* Function : PLIB_DMA_ExistsCRCPolynomialLength( DMA_MODULE_ID index )
12299  Summary:
12300  Identifies whether the CRCPolynomialLength feature exists on the DMA module.
12301  Description:
12302  This function identifies whether the CRCPolynomialLength feature is available
12303  on the DMA module.
12304  When this function returns true, these functions are supported on the device:
12305  - PLIB_DMA_CRCPolynomialLengthSet
12306  - PLIB_DMA_CRCPolynomialLengthGet
12307  Preconditions:
12308  None.
12309  Parameters:
12310  index - Identifier for the device instance
12311  Returns:
12312  - true - The CRCPolynomialLength feature is supported on the device
12313  - false - The CRCPolynomialLength feature is not supported on the device
12314  Remarks:
12315  None.
12316 */
12317 
12318 bool
12320  DMA_MODULE_ID index ) ;
12321 //******************************************************************************
12322 /* Function : PLIB_DMA_ExistsCRCBitOrder( DMA_MODULE_ID index )
12323  Summary:
12324  Identifies whether the CRCBitOrder feature exists on the DMA module.
12325  Description:
12326  This function identifies whether the CRCBitOrder feature is available on the
12327  DMA module.
12328  When this function returns true, this function is supported on the device:
12329  - PLIB_DMA_CRCBitOrderSelect
12330  Preconditions:
12331  None.
12332  Parameters:
12333  index - Identifier for the device instance
12334  Returns:
12335  - true - The CRCBitOrder feature is supported on the device
12336  - false - The CRCBitOrder feature is not supported on the device
12337  Remarks:
12338  None.
12339 */
12340 
12341 bool
12343  DMA_MODULE_ID index ) ;
12344 //******************************************************************************
12345 /* Function : PLIB_DMA_ExistsCRCWriteByteOrder( DMA_MODULE_ID index )
12346  Summary:
12347  Identifies whether the CRCWriteByteOrder feature exists on the DMA module.
12348  Description:
12349  This function identifies whether the CRCWriteByteOrder feature is available
12350  on the DMA module.
12351  When this function returns true, these functions are supported on the device:
12352  - PLIB_DMA_CRCWriteByteOrderAlter
12353  - PLIB_DMA_CRCWriteByteOrderMaintain
12354  Preconditions:
12355  None.
12356  Parameters:
12357  index - Identifier for the device instance
12358  Returns:
12359  - true - The CRCWriteByteOrder feature is supported on the device
12360  - false - The CRCWriteByteOrder feature is not supported on the device
12361  Remarks:
12362  None.
12363 */
12364 
12365 bool
12367  DMA_MODULE_ID index ) ;
12368 //******************************************************************************
12369 /* Function : PLIB_DMA_ExistsCRCByteOrder( DMA_MODULE_ID index )
12370  Summary:
12371  Identifies whether the CRCByteOrder feature exists on the DMA module.
12372  Description:
12373  This function identifies whether the CRCByteOrder feature is available on
12374  the DMA module.
12375  When this function returns true, these functions are supported on the device:
12376  - PLIB_DMA_CRCByteOrderSelect
12377  - PLIB_DMA_CRCByteOrderGet
12378  Preconditions:
12379  None.
12380  Parameters:
12381  index - Identifier for the device instance
12382  Returns:
12383  - true - The CRCByteOrder feature is supported on the device
12384  - false - The CRCByteOrder feature is not supported on the device
12385  Remarks:
12386  None.
12387 */
12388 
12389 bool
12391  DMA_MODULE_ID index ) ;
12392 //******************************************************************************
12393 /* Function : PLIB_DMA_ExistsCRCData( DMA_MODULE_ID index )
12394  Summary:
12395  Identifies whether the CRCData feature exists on the DMA module.
12396  Description:
12397  This function identifies whether the CRCData feature is available on the
12398  DMA module.
12399  When this function returns true, these functions are supported on the device:
12400  - PLIB_DMA_CRCDataRead
12401  - PLIB_DMA_CRCDataWrite
12402  Preconditions:
12403  None.
12404  Parameters:
12405  index - Identifier for the device instance
12406  Returns:
12407  - true - The CRCData feature is supported on the device
12408  - false - The CRCData feature is not supported on the device
12409  Remarks:
12410  None.
12411 */
12412 
12413 bool
12415  DMA_MODULE_ID index ) ;
12416 //******************************************************************************
12417 /* Function : PLIB_DMA_ExistsCRCXOREnable( DMA_MODULE_ID index )
12418  Summary:
12419  Identifies whether the CRCXOREnable feature exists on the DMA module.
12420  Description:
12421  This function identifies whether the CRCXOREnable feature is available on the
12422  DMA module.
12423  When this function returns true, these functions are supported on the device:
12424  - PLIB_DMA_CRCXOREnableSet
12425  - PLIB_DMA_CRCXOREnableGet
12426  Preconditions:
12427  None.
12428  Parameters:
12429  index - Identifier for the device instance
12430  Returns:
12431  - true - The CRCXOREnable feature is supported on the device
12432  - false - The CRCXOREnable feature is not supported on the device
12433  Remarks:
12434  None.
12435 */
12436 
12437 bool
12439  DMA_MODULE_ID index ) ;
12440 //******************************************************************************
12441 /* Function : PLIB_DMA_ExistsChannelXPriority( DMA_MODULE_ID index )
12442  Summary:
12443  Identifies whether the ChannelXPriority feature exists on the DMA module.
12444  Description:
12445  This function identifies whether the ChannelXPriority feature is available on
12446  the DMA module.
12447  When this function returns true, these functions are supported on the device:
12448  - PLIB_DMA_ChannelXPrioritySelect
12449  - PLIB_DMA_ChannelXPriorityGet
12450  Preconditions:
12451  None.
12452  Parameters:
12453  index - Identifier for the device instance
12454  Returns:
12455  - true - The ChannelXPriority feature is supported on the device
12456  - false - The ChannelXPriority feature is not supported on the device
12457  Remarks:
12458  None.
12459 */
12460 
12461 bool
12463  DMA_MODULE_ID index ) ;
12464 //******************************************************************************
12465 /* Function : PLIB_DMA_ExistsChannelXEvent( DMA_MODULE_ID index )
12466  Summary:
12467  Identifies whether the ChannelXEvent feature exists on the DMA module.
12468  Description:
12469  This function identifies whether the ChannelXEvent feature is available on
12470  the DMA module.
12471  When this function returns true, this function is supported on the device:
12472  - PLIB_DMA_ChannelXEventIsDetected
12473  Preconditions:
12474  None.
12475  Parameters:
12476  index - Identifier for the device instance
12477  Returns:
12478  - true - The ChannelXEvent feature is supported on the device
12479  - false - The ChannelXEvent feature is not supported on the device
12480  Remarks:
12481  None.
12482 */
12483 
12484 bool
12486  DMA_MODULE_ID index ) ;
12487 //******************************************************************************
12488 /* Function : PLIB_DMA_ExistsChannelXAuto( DMA_MODULE_ID index )
12489  Summary:
12490  Identifies whether the ChannelXAuto feature exists on the DMA module.
12491  Description:
12492  This function identifies whether the ChannelXAuto feature is available on
12493  the DMA module.
12494  When this function returns true, these functions are supported on the device:
12495  - PLIB_DMA_ChannelXAutoEnable
12496  - PLIB_DMA_ChannelXAutoDisable
12497  - PLIB_DMA_ChannelXAutoIsEnabled
12498  Preconditions:
12499  None.
12500  Parameters:
12501  index - Identifier for the device instance
12502  Returns:
12503  - true - The ChannelXAuto feature is supported on the device
12504  - false - The ChannelXAuto feature is not supported on the device
12505  Remarks:
12506  None.
12507 */
12508 
12509 bool
12511  DMA_MODULE_ID index ) ;
12512 //******************************************************************************
12513 /* Function : PLIB_DMA_ExistsChannelXChainEnbl( DMA_MODULE_ID index )
12514  Summary:
12515  Identifies whether the ChannelXChainEnbl feature exists on the DMA module.
12516  Description:
12517  This function identifies whether the ChannelXChainEnbl feature is available
12518  on the DMA module.
12519  When this function returns true, these functions are supported on the device:
12520  - PLIB_DMA_ChannelXChainEnable
12521  - PLIB_DMA_ChannelXChainDisable
12522  - PLIB_DMA_ChannelXChainIsEnabled
12523  Preconditions:
12524  None.
12525  Parameters:
12526  index - Identifier for the device instance
12527  Returns:
12528  - true - The ChannelXChainEnbl feature is supported on the device
12529  - false - The ChannelXChainEnbl feature is not supported on the device
12530  Remarks:
12531  None.
12532 */
12533 
12534 bool
12536  DMA_MODULE_ID index ) ;
12537 //******************************************************************************
12538 /* Function : PLIB_DMA_ExistsChannelXDisabled( DMA_MODULE_ID index )
12539  Summary:
12540  Identifies whether the ChannelXDisabled feature exists on the DMA module.
12541  Description:
12542  This function identifies whether the ChannelXDisabled feature is available
12543  on the DMA module.
12544  When this function returns true, these functions are supported on the device:
12545  - PLIB_DMA_ChannelXDisabledEnablesEvents
12546  - PLIB_DMA_ChannelXDisabledDisablesEvents
12547  Preconditions:
12548  None.
12549  Parameters:
12550  index - Identifier for the device instance
12551  Returns:
12552  - true - The ChannelXDisabled feature is supported on the device
12553  - false - The ChannelXDisabled feature is not supported on the device
12554  Remarks:
12555  None.
12556 */
12557 
12558 bool
12560  DMA_MODULE_ID index ) ;
12561 //******************************************************************************
12562 /* Function : PLIB_DMA_ExistsChannelX( DMA_MODULE_ID index )
12563  Summary:
12564  Identifies whether the ChannelX feature exists on the DMA module.
12565  Description:
12566  This function identifies whether the ChannelX feature is available on the
12567  DMA module.
12568  When this function returns true, these functions are supported on the device:
12569  - PLIB_DMA_ChannelXEnable
12570  - PLIB_DMA_ChannelXIsEnabled
12571  - PLIB_DMA_ChannelXDisable
12572  Preconditions:
12573  None.
12574  Parameters:
12575  index - Identifier for the device instance
12576  Returns:
12577  - true - The ChannelX feature is supported on the device
12578  - false - The ChannelX feature is not supported on the device
12579  Remarks:
12580  None.
12581 */
12582 
12583 bool
12585  DMA_MODULE_ID index ) ;
12586 //******************************************************************************
12587 /* Function : PLIB_DMA_ExistsChannelXChain( DMA_MODULE_ID index )
12588  Summary:
12589  Identifies whether the ChannelXChain feature exists on the DMA module.
12590  Description:
12591  This function identifies whether the ChannelXChain feature is available on the
12592  DMA module.
12593  When this function returns true, these functions are supported on the device:
12594  - PLIB_DMA_ChannelXChainToLower
12595  - PLIB_DMA_ChannelXChainToHigher
12596  Preconditions:
12597  None.
12598  Parameters:
12599  index - Identifier for the device instance
12600  Returns:
12601  - true - The ChannelXChain feature is supported on the device
12602  - false - The ChannelXChain feature is not supported on the device
12603  Remarks:
12604  None.
12605 */
12606 
12607 bool
12609  DMA_MODULE_ID index ) ;
12610 //******************************************************************************
12611 /* Function : PLIB_DMA_ExistsChannelXPatternLength( DMA_MODULE_ID index )
12612  Summary:
12613  Identifies whether the ChannelXPatternLength feature exists on the DMA module.
12614  Description:
12615  This function identifies whether the ChannelXPatternLength feature is available
12616  on the DMA module.
12617  When this function returns true, these functions are supported on the device:
12618  - PLIB_DMA_ChannelXPatternLengthSet
12619  - PLIB_DMA_ChannelXPatternLengthGet
12620  Preconditions:
12621  None.
12622  Parameters:
12623  index - Identifier for the device instance
12624  Returns:
12625  - true - The ChannelXPatternLength feature is supported on the device
12626  - false - The ChannelXPatternLength feature is not supported on the device
12627  Remarks:
12628  None.
12629 */
12630 
12631 bool
12633  DMA_MODULE_ID index ) ;
12634 //******************************************************************************
12635 /* Function : PLIB_DMA_ExistsChannelXPatternIgnoreByte( DMA_MODULE_ID index )
12636  Summary:
12637  Identifies whether the ChannelXPatternIgnoreByte feature exists on the DMA
12638  module.
12639  Description:
12640  This function identifies whether the ChannelXPatternIgnoreByte feature is
12641  available on the DMA module.
12642  When this function returns true, these functions are supported on the device:
12643  - PLIB_DMA_ChannelXPatternIgnoreByteEnable
12644  - PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled
12645  - PLIB_DMA_ChannelXPatternIgnoreByteDisable
12646  Preconditions:
12647  None.
12648  Parameters:
12649  index - Identifier for the device instance
12650  Returns:
12651  - true - The ChannelXPatternIgnoreByte feature is supported on the device
12652  - false - The ChannelXPatternIgnoreByte feature is not supported on the device
12653  Remarks:
12654  None.
12655 */
12656 
12657 bool
12659  DMA_MODULE_ID index ) ;
12660 //******************************************************************************
12661 /* Function : PLIB_DMA_ExistsChannelXBusy( DMA_MODULE_ID index )
12662  Summary:
12663  Identifies whether the ChannelXBusy feature exists on the DMA module.
12664  Description:
12665  This function identifies whether the ChannelXBusy feature is available on the
12666  DMA module.
12667  When this function returns true, these functions are supported on the device:
12668  - PLIB_DMA_ChannelXBusyActiveSet
12669  - PLIB_DMA_ChannelXBusyInActiveSet
12670  - PLIB_DMA_ChannelXBusyIsBusy
12671  Preconditions:
12672  None.
12673  Parameters:
12674  index - Identifier for the device instance
12675  Returns:
12676  - true - The ChannelXBusy feature is supported on the device
12677  - false - The ChannelXBusy feature is not supported on the device
12678  Remarks:
12679  None.
12680 */
12681 
12682 bool
12684  DMA_MODULE_ID index ) ;
12685 //******************************************************************************
12686 /* Function : PLIB_DMA_ExistsChannelXPatternIgnore( DMA_MODULE_ID index )
12687  Summary:
12688  Identifies whether the ChannelXPatternIgnore feature exists on the DMA module.
12689  Description:
12690  This function identifies whether the ChannelXPatternIgnore feature is available
12691  on the DMA module.
12692  When this function returns true, these functions are supported on the device:
12693  - PLIB_DMA_ChannelXPatternIgnoreSet
12694  - PLIB_DMA_ChannelXPatternIgnoreGet
12695  Preconditions:
12696  None.
12697  Parameters:
12698  index - Identifier for the device instance
12699  Returns:
12700  - true - The ChannelXPatternIgnore feature is supported on the device
12701  - false - The ChannelXPatternIgnore feature is not supported on the device
12702  Remarks:
12703  None.
12704 */
12705 
12706 bool
12708  DMA_MODULE_ID index ) ;
12709 //******************************************************************************
12710 /* Function : PLIB_DMA_ExistsChannelXTrigger( DMA_MODULE_ID index )
12711  Summary:
12712  Identifies whether the ChannelXTrigger feature exists on the DMA module.
12713  Description:
12714  This function identifies whether the ChannelXTrigger feature is available on
12715  the DMA module.
12716  When this function returns true, these functions are supported on the device:
12717  - PLIB_DMA_ChannelXTriggerEnable
12718  - PLIB_DMA_ChannelXTriggerIsEnabled
12719  - PLIB_DMA_ChannelXTriggerDisable
12720  Preconditions:
12721  None.
12722  Parameters:
12723  index - Identifier for the device instance
12724  Returns:
12725  - true - The ChannelXTrigger feature is supported on the device
12726  - false - The ChannelXTrigger feature is not supported on the device
12727  Remarks:
12728  None.
12729 */
12730 
12731 bool
12733  DMA_MODULE_ID index ) ;
12734 //******************************************************************************
12735 /* Function : PLIB_DMA_ExistsAbortTransfer( DMA_MODULE_ID index )
12736  Summary:
12737  Identifies whether the AbortTransfer feature exists on the DMA module.
12738  Description:
12739  This function identifies whether the AbortTransfer feature is available on
12740  the DMA module.
12741  When this function returns true, this function is supported on the device:
12742  - PLIB_DMA_AbortTransferSet
12743  Preconditions:
12744  None.
12745  Parameters:
12746  index - Identifier for the device instance
12747  Returns:
12748  - true - The AbortTransfer feature is supported on the device
12749  - false - The AbortTransfer feature is not supported on the device
12750  Remarks:
12751  None.
12752 */
12753 
12754 bool
12756  DMA_MODULE_ID index ) ;
12757 //******************************************************************************
12758 /* Function : PLIB_DMA_ExistsStartTransfer( DMA_MODULE_ID index )
12759  Summary:
12760  Identifies whether the StartTransfer feature exists on the DMA module.
12761  Description:
12762  This function identifies whether the StartTransfer feature is available on
12763  the DMA module.
12764  When this function returns true, this function is supported on the device:
12765  - PLIB_DMA_StartTransferSet
12766  Preconditions:
12767  None.
12768  Parameters:
12769  index - Identifier for the device instance
12770  Returns:
12771  - true - The StartTransfer feature is supported on the device
12772  - false - The StartTransfer feature is not supported on the device
12773  Remarks:
12774  None.
12775 */
12776 
12777 bool
12779  DMA_MODULE_ID index ) ;
12780 //******************************************************************************
12781 /* Function : PLIB_DMA_ExistsChannelXStartIRQ( DMA_MODULE_ID index )
12782  Summary:
12783  Identifies whether the ChannelXStartIRQ feature exists on the DMA module.
12784  Description:
12785  This function identifies whether the ChannelXStartIRQ feature is available
12786  on the DMA module.
12787  When this function returns true, this function is supported on the device:
12788  - PLIB_DMA_ChannelXStartIRQSet
12789  Preconditions:
12790  None.
12791  Parameters:
12792  index - Identifier for the device instance
12793  Returns:
12794  - true - The ChannelXStartIRQ feature is supported on the device
12795  - false - The ChannelXStartIRQ feature is not supported on the device
12796  Remarks:
12797  None.
12798 */
12799 
12800 bool
12802  DMA_MODULE_ID index ) ;
12803 //******************************************************************************
12804 /* Function : PLIB_DMA_ExistsChannelXAbortIRQ( DMA_MODULE_ID index )
12805  Summary:
12806  Identifies whether the ChannelXAbortIRQ feature exists on the DMA module.
12807  Description:
12808  This function identifies whether the ChannelXAbortIRQ feature is available
12809  on the DMA module.
12810  When this function returns true, this function is supported on the device:
12811  - PLIB_DMA_ChannelXAbortIRQSet
12812  Preconditions:
12813  None.
12814  Parameters:
12815  index - Identifier for the device instance
12816  Returns:
12817  - true - The ChannelXAbortIRQ feature is supported on the device
12818  - false - The ChannelXAbortIRQ feature is not supported on the device
12819  Remarks:
12820  None.
12821 */
12822 
12823 bool
12825  DMA_MODULE_ID index ) ;
12826 //******************************************************************************
12827 /* Function : PLIB_DMA_ExistsChannelXINTSourceFlag( DMA_MODULE_ID index )
12828  Summary:
12829  Identifies whether the ChannelXINTSourceFlag feature exists on the DMA module.
12830  Description:
12831  This function identifies whether the ChannelXINTSourceFlag feature is available
12832  on the DMA module.
12833  When this function returns true, these functions are supported on the device:
12834  - PLIB_DMA_ChannelXINTSourceFlagGet
12835  - PLIB_DMA_ChannelXINTSourceFlagSet
12836  - PLIB_DMA_ChannelXINTSourceFlagClear
12837  Preconditions:
12838  None.
12839  Parameters:
12840  index - Identifier for the device instance
12841  Returns:
12842  - true - The ChannelXINTSourceFlag feature is supported on the device
12843  - false - The ChannelXINTSourceFlag feature is not supported on the device
12844  Remarks:
12845  None.
12846 */
12847 
12848 bool
12850  DMA_MODULE_ID index ) ;
12851 //******************************************************************************
12852 /* Function : PLIB_DMA_ExistsChannelXINTSource( DMA_MODULE_ID index )
12853  Summary:
12854  Identifies whether the ChannelXINTSource feature exists on the DMA module.
12855  Description:
12856  This function identifies whether the ChannelXINTSource feature is available
12857  on the DMA module.
12858  When this function returns true, these functions are supported on the device:
12859  - PLIB_DMA_ChannelXINTSourceEnable
12860  - PLIB_DMA_ChannelXINTSourceDisable
12861  - PLIB_DMA_ChannelXINTSourceIsEnabled
12862  Preconditions:
12863  None.
12864  Parameters:
12865  index - Identifier for the device instance
12866  Returns:
12867  - true - The ChannelXINTSource feature is supported on the device
12868  - false - The ChannelXINTSource feature is not supported on the device
12869  Remarks:
12870  None.
12871 */
12872 
12873 bool
12875  DMA_MODULE_ID index ) ;
12876 //******************************************************************************
12877 /* Function : PLIB_DMA_ExistsChannelXSourceStartAddress( DMA_MODULE_ID index )
12878  Summary:
12879  Identifies whether the ChannelXSourceStartAddress feature exists on the DMA module.
12880  Description:
12881  This function identifies whether the ChannelXSourceStartAddress feature is available
12882  on the DMA module.
12883  When this function returns true, these functions are supported on the device:
12884  - PLIB_DMA_ChannelXSourceStartAddressGet
12885  - PLIB_DMA_ChannelXSourceStartAddressSet
12886  Preconditions:
12887  None.
12888  Parameters:
12889  index - Identifier for the device instance
12890  Returns:
12891  - true - The ChannelXSourceStartAddress feature is supported on the device
12892  - false - The ChannelXSourceStartAddress feature is not supported on the device
12893  Remarks:
12894  None.
12895 */
12896 
12897 bool
12899  DMA_MODULE_ID index ) ;
12900 //******************************************************************************
12901 /* Function : PLIB_DMA_ExistsChannelXDestinationStartAddress( DMA_MODULE_ID index )
12902  Summary:
12903  Identifies whether the ChannelXDestinationStartAddress feature exists on
12904  the DMA module.
12905  Description:
12906  This function identifies whether the ChannelXDestinationStartAddress feature
12907  is available on the DMA module.
12908  When this function returns true, these functions are supported on the device:
12909  - PLIB_DMA_ChannelXDestinationStartAddressGet
12910  - PLIB_DMA_ChannelXDestinationStartAddressSet
12911  Preconditions:
12912  None.
12913  Parameters:
12914  index - Identifier for the device instance
12915  Returns:
12916  - true - The ChannelXDestinationStartAddress feature is supported on the device
12917  - false - The ChannelXDestinationStartAddress feature is not supported on the device
12918  Remarks:
12919  None.
12920 */
12921 
12922 bool
12924  DMA_MODULE_ID index ) ;
12925 //******************************************************************************
12926 /* Function : PLIB_DMA_ExistsChannelXSourceSize( DMA_MODULE_ID index )
12927  Summary:
12928  Identifies whether the ChannelXSourceSize feature exists on the DMA module.
12929  Description:
12930  This function identifies whether the ChannelXSourceSize feature is available
12931  on the DMA module.
12932  When this function returns true, these functions are supported on the device:
12933  - PLIB_DMA_ChannelXSourceSizeGet
12934  - PLIB_DMA_ChannelXSourceSizeSet
12935  Preconditions:
12936  None.
12937  Parameters:
12938  index - Identifier for the device instance
12939  Returns:
12940  - true - The ChannelXSourceSize feature is supported on the device
12941  - false - The ChannelXSourceSize feature is not supported on the device
12942  Remarks:
12943  None.
12944 */
12945 
12946 bool
12948  DMA_MODULE_ID index ) ;
12949 //******************************************************************************
12950 /* Function : PLIB_DMA_ExistsChannelXDestinationSize( DMA_MODULE_ID index )
12951  Summary:
12952  Identifies whether the ChannelXDestinationSize feature exists on the DMA module.
12953  Description:
12954  This function identifies whether the ChannelXDestinationSize feature is available
12955  on the DMA module.
12956  When this function returns true, these functions are supported on the device:
12957  - PLIB_DMA_ChannelXDestinationSizeGet
12958  - PLIB_DMA_ChannelXDestinationSizeSet
12959  Preconditions:
12960  None.
12961  Parameters:
12962  index - Identifier for the device instance
12963  Returns:
12964  - true - The ChannelXDestinationSize feature is supported on the device
12965  - false - The ChannelXDestinationSize feature is not supported on the device
12966  Remarks:
12967  None.
12968 */
12969 
12970 bool
12972  DMA_MODULE_ID index ) ;
12973 //******************************************************************************
12974 /* Function : PLIB_DMA_ExistsChannelXSourcePointer( DMA_MODULE_ID index )
12975  Summary:
12976  Identifies whether the ChannelXSourcePointer feature exists on the DMA module.
12977  Description:
12978  This function identifies whether the ChannelXSourcePointer feature is available
12979  on the DMA module.
12980  When this function returns true, this function is supported on the device:
12981  - PLIB_DMA_ChannelXSourcePointerGet
12982  Preconditions:
12983  None.
12984  Parameters:
12985  index - Identifier for the device instance
12986  Returns:
12987  - true - The ChannelXSourcePointer feature is supported on the device
12988  - false - The ChannelXSourcePointer feature is not supported on the device
12989  Remarks:
12990  None.
12991 */
12992 
12993 bool
12995  DMA_MODULE_ID index ) ;
12996 //******************************************************************************
12997 /* Function : PLIB_DMA_ExistsChannelXDestinationPointer( DMA_MODULE_ID index )
12998  Summary:
12999  Identifies whether the ChannelXDestinationPointer feature exists on the DMA module.
13000  Description:
13001  This function identifies whether the ChannelXDestinationPointer feature is available
13002  on the DMA module.
13003  When this function returns true, this function is supported on the device:
13004  - PLIB_DMA_ChannelXDestinationPointerGet
13005  Preconditions:
13006  None.
13007  Parameters:
13008  index - Identifier for the device instance
13009  Returns:
13010  - true - The ChannelXDestinationPointer feature is supported on the device
13011  - false - The ChannelXDestinationPointer feature is not supported on the device
13012  Remarks:
13013  None.
13014 */
13015 
13016 bool
13018  DMA_MODULE_ID index ) ;
13019 //******************************************************************************
13020 /* Function : PLIB_DMA_ExistsChannelXCellSize( DMA_MODULE_ID index )
13021  Summary:
13022  Identifies whether the ChannelXCellSize feature exists on the DMA module.
13023  Description:
13024  This function identifies whether the ChannelXCellSize feature is available on
13025  the DMA module.
13026  When this function returns true, these functions are supported on the device:
13027  - PLIB_DMA_ChannelXCellSizeGet
13028  - PLIB_DMA_ChannelXCellSizeSet
13029  Preconditions:
13030  None.
13031  Parameters:
13032  index - Identifier for the device instance
13033  Returns:
13034  - true - The ChannelXCellSize feature is supported on the device
13035  - false - The ChannelXCellSize feature is not supported on the device
13036  Remarks:
13037  None.
13038 */
13039 
13040 bool
13042  DMA_MODULE_ID index ) ;
13043 //******************************************************************************
13044 /* Function : PLIB_DMA_ExistsChannelXCellProgressPointer( DMA_MODULE_ID index )
13045  Summary:
13046  Identifies whether the ChannelXCellProgressPointer feature exists on the
13047  DMA module.
13048  Description:
13049  This function identifies whether the ChannelXCellProgressPointer feature is
13050  available on the DMA module.
13051  When this function returns true, this function is supported on the device:
13052  - PLIB_DMA_ChannelXCellProgressPointerGet
13053  Preconditions:
13054  None.
13055  Parameters:
13056  index - Identifier for the device instance
13057  Returns:
13058  - true - The ChannelXCellProgressPointer feature is supported on the device
13059  - false - The ChannelXCellProgressPointer feature is not supported on the device
13060  Remarks:
13061  None.
13062 */
13063 
13064 bool
13066  DMA_MODULE_ID index ) ;
13067 //******************************************************************************
13068 /* Function : PLIB_DMA_ExistsChannelXPatternData( DMA_MODULE_ID index )
13069  Summary:
13070  Identifies whether the ChannelXPatternData feature exists on the DMA module
13071  Description:
13072  This function identifies whether the ChannelXPatternData feature is available
13073  on the DMA module.
13074  When this function returns true, these functions are supported on the device:
13075  - PLIB_DMA_ChannelXPatternDataGet
13076  - PLIB_DMA_ChannelXPatternDataSet
13077  Preconditions:
13078  None.
13079  Parameters:
13080  index - Identifier for the device instance
13081  Returns:
13082  - true - The ChannelXPatternData feature is supported on the device
13083  - false - The ChannelXPatternData feature is not supported on the device
13084  Remarks:
13085  None.
13086 */
13087 
13088 bool
13090  DMA_MODULE_ID index ) ;
13091 //DOM-IGNORE-BEGIN
13092 //DOM-IGNORE-END
13093  // #ifndef _PLIB_DMA_H
13094 /*******************************************************************************
13095  End of File
13096 */
13097 
13098 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\dma\plib_dma.h*/
13099 /* CLOSE_FILE Include File */
13100 
13101 // *****************************************************************************
13102 // *****************************************************************************
13103 // Section: Data Types
13104 // *****************************************************************************
13105 // *****************************************************************************
13106 // *****************************************************************************
13107 /* DMA System Service Channel None
13108  Summary:
13109  DMA channel none
13110  Description:
13111  This constant identifies the specification of no choice from client
13112  for allocating a particular DMA channel.
13113  Remarks:
13114  This constant should be used in place of hard-coded numeric literals.
13115 */
13116 //DOM-IGNORE-BEGIN
13117 #define DMA_CHANNEL_NONE ( ( DMA_CHANNEL ) - 1 )
13118 //DOM-IGNORE-END
13119 // *****************************************************************************
13120 /* DMA System Service Channel Any
13121  Summary:
13122  Identifies the client specification to allocate any available DMA channel.
13123  Description:
13124  This constant identifies the specification by the client
13125  to allocate any available DMA channel.
13126  Remarks:
13127  This constant should be used in place of hard-coded numeric literals.
13128 */
13129 //DOM-IGNORE-BEGIN
13130 #define DMA_CHANNEL_ANY ( ( DMA_CHANNEL ) - 2 )
13131 //DOM-IGNORE-END
13132 // *****************************************************************************
13133 /* DMA System Service Channel Count
13134  Summary:
13135  Identifies the maximum number of DMA channel handles to be defined.
13136  Description:
13137  This constant identifies the maximum number of DMA channel handles
13138  that should be defined.
13139  Remarks:
13140  This value is derived from device-specific header files defined as
13141  part of the peripheral libraries.
13142 */
13143 #define SYS_DMA_CHANNEL_COUNT DMA_NUMBER_OF_CHANNELS
13144 // *****************************************************************************
13145 /* DMA System Service Channel Handle
13146  Summary:
13147  Assigns the handle for requested channel.
13148  Description:
13149  A channel handle value is returned by a call to the SYS_DMA_ChannelAllocate
13150  function. This handle is associated with the channel number that is used for
13151  data transfer and it allows the application to track the data transfer.
13152  The channel handle once assigned to a client expires when the
13153  client calls SYS_DMA_ChannelRelease.
13154  exits.
13155  Remarks:
13156  None.
13157 */
13158 
13159 typedef
13160 uintptr_t
13162 // *****************************************************************************
13163 /* DMA System Service Invalid Channel Handle
13164  Summary:
13165  Defines an invalid channel handle.
13166  Description:
13167  This is the definition of an invalid channel handle. An invalid buffer handle
13168  is returned by SYS_DMA_ChannelAllocate function if the channel number
13169  request was not successful.
13170  Remarks:
13171  None.
13172 */
13173 #define SYS_DMA_CHANNEL_HANDLE_INVALID ( ( SYS_DMA_CHANNEL_HANDLE ) ( - 1 ) )
13174 // *****************************************************************************
13175 /* DMA stop in idle mode
13176  Summary:
13177  Enable/Disable DMA operations in Idle mode.
13178  Description:
13179  This data type allows enabling/disabling of DMA operations in idle mode.
13180  Remarks:
13181  The field 'sidl' (in init data structure 'SYS_DMA_INIT') is enable/disable
13182  while initializing the DMA module by calling SYS_DMA_Initialize.
13183  This feature may not be available on all devices. Refer to the specific device
13184  data sheet to determine availability.
13185 */
13186 
13187 typedef
13188  enum
13189  {
13190  /* When the CPU enters idle mode, the DMA module continue operations */
13192  /* When the CPU enters idle mode, the DMA module will discontinue operations */
13194  } SYS_DMA_SIDL ;
13195 // *****************************************************************************
13196 /* DMA Channel chaining priority
13197  Summary:
13198  Identifies the priority of chaining channel.
13199  Description:
13200  This data type identifies the priority of chaining channel.
13201  Channel chaining priority identifies the channel that will be enabled
13202  on completion of block data transfer on the master channel.
13203  Remarks:
13204  None.
13205 */
13206 
13207 typedef
13208  enum
13209  {
13210  /* Chain to channel higher in natural priority */
13212  /* Chain to channel lower in natural priority */
13215 // *****************************************************************************
13216 /* DMA Channel ignore pattern match
13217  Summary:
13218  Enables/Disables the feature to ignore a byte between a 2-byte match abort
13219  pattern.
13220  Description:
13221  This data type allows enabling/disabling the feature to ignore a byte
13222  between a 2-byte match abort pattern.
13223  Remarks:
13224  This feature may not be available on all devices. Refer to the specific device
13225  data sheet to determine availability.
13226 */
13227 
13228 typedef
13229  enum
13230  {
13231  /* Disabling the feature to ignore a byte between a 2-byte match abort pattern. */
13233  /* Enable the feature to ignore a byte between a 2-byte match abort pattern. */
13236 // *****************************************************************************
13237 /* DMA channel CRC mode
13238  Summary:
13239  Identifies the operation mode of the CRC module.
13240  Description:
13241  This data type identifies CRC operating mode. The CRC computation can be
13242  in background mode or append mode.
13243  Remarks:
13244  None.
13245 */
13246 
13247 typedef
13248  enum
13249  {
13250  /* DMA reads the data from the source, passes it through the CRC module and
13251  writes it to the destination. the calculated CRC is left in the DCRCDATA
13252  register at the end of the block transfer. */
13254  /* DMA only feeds source data to the CRC module. it does not write source data
13255  to the destination address. When a block transfer complete or pattern abort
13256  event occur, The DMA writes the CRC value to the destination address */
13259 // *****************************************************************************
13260 /* DMA channel CRC write order
13261  Summary:
13262  Identifies altering/maintaining write order post CRC computation.
13263  Description:
13264  This data type identifies write byte order selection post CRC
13265  computation.
13266  Remarks:
13267  None.
13268 */
13269 
13270 typedef
13271  enum
13272  {
13273  /* Source data is written to the destination unchanged regardless
13274  of the selected pre-CRC byte order. */
13276  /* Source data is written to the destination reordered according
13277  to the selected pre-CRC byte order. */
13280 // *****************************************************************************
13281 /* DMA channel operation modes
13282  Summary:
13283  Identifies the available DMA operating modes.
13284  Description:
13285  This data type Identifies the available DMA operating modes.
13286  The supported DMA modes are not mutually exclusive, but can be simultaneously
13287  operational.
13288  Remarks:
13289  These supported DMA modes can be logically OR'd together. They are passed
13290  into the SYS_DMA_ChannelSetup function through the modeEnable parameter.
13291 */
13292 
13293 typedef
13294  enum
13295  {
13296  /* The normal DMA operation mode. The DMA channel will transfer data from
13297  a source to a destination without CPU intervention */
13298  SYS_DMA_CHANNEL_OP_MODE_BASIC /*DOM-IGNORE-BEGIN*/
13299  = ( 1 << 0 ) /*DOM-IGNORE-END*/
13300  ,
13301  /* Pattern Match abort mode allows the user to end a transfer if data
13302  written during a transaction matches a specific pattern, as defined by
13303  the DCHxDAT register */
13305  = ( 1 << 1 ) /*DOM-IGNORE-END*/
13306  ,
13307  /* Channel chaining operating mode enhances the normal DMA channel
13308  operations. A channel(slave) can be chained to an adjacent channel(master).
13309  The slave channel will be enabled when a block transfer of the master
13310  channel completes. */
13311  /* only one of the below two chaining priorities must be provided.
13312  Chaining priority High. */
13314  = ( 1 << 2 ) /*DOM-IGNORE-END*/
13315  ,
13316  /* Chaining priority Low */
13318  = ( 1 << 3 ) /*DOM-IGNORE-END*/
13319  ,
13320  /* Auto enable operating mode allows a channel to be kept active, even if a
13321  block transfer completes or pattern match occurs. This prevents the user
13322  from having to re-enable the channel each time a block transfer completes. */
13323  SYS_DMA_CHANNEL_OP_MODE_AUTO/*DOM-IGNORE-BEGIN*/
13324  = ( 1 << 4 ) /*DOM-IGNORE-END*/
13325  ,
13326  /* CRC operating mode allows computation of 16, 32-bit CRC. */
13327  SYS_DMA_CHANNEL_OP_MODE_CRC/*DOM-IGNORE-BEGIN*/
13328  = ( 1 << 5 ) /*DOM-IGNORE-END*/
13330 // *****************************************************************************
13331 /* DMA channel CRC mode
13332  Summary:
13333  Defines the attributes for CRC operation mode.
13334  Description:
13335  This data type defines the attributes for CRC operation mode.
13336  Remarks:
13337  This feature may not be available on all devices. Refer to the specific device
13338  data sheet to determine availability.
13339 */
13340 
13341 typedef
13342  struct
13343  {
13344  /* CRC type (PLIB-level).
13345  Type Selection identifies whether the CRC module will calculate an IP
13346  header checksum or an LFSR CRC */
13347  DMA_CRC_TYPE type ;
13348  /* CRC mode, Background or Append */
13350  /* Polynomial length, This value is redundant when the selected CRC type is
13351  IP header checksum. When the CRC type is LFSR, Identifies the length of
13352  the polynomial. */
13353  uint8_t polyLength ;
13354  /* Bit order (PLIB-level).
13355  Identifies whether the CRC is computed LSb or MSb first */
13356  DMA_CRC_BIT_ORDER bitOrder ;
13357  /* Byte order (PLIB-level).
13358  Identifies the byte selection order input pre-CRC Generator. */
13359  DMA_CRC_BYTE_ORDER byteOrder ;
13360  /* Post CRC Write order */
13361  SYS_DMA_CRC_WRITE_ORDER writeOrder ;
13362  /* CRC data feed: While enabling the CRC mode, this field gives
13363  the seed for the CRC computation. On block transfer complete or
13364  pattern match abort the field have the computed CRC. */
13365  uint32_t data ;
13366  /* XOR bit mask, This value is redundant when the selected CRC type is
13367  IP header checksum. When the CRC type is LFSR, Identifies the XOR
13368  bit mask input to the shift register during CRC computation. */
13369  uint32_t xorBitMask ;
13371 // *****************************************************************************
13372 /* DMA System service Events
13373  Summary:
13374  Enumeration of possible DMA System service events.
13375  Description:
13376  This data type provides an enumeration of all possible DMA System service events.
13377  Remarks:
13378  None.
13379 */
13380 
13381 typedef
13382  enum
13383  {
13384  /* Data was transferred successfully. */
13386  /* Error while processing the request */
13388  /* Data transfer was aborted. */
13390  /* No events yet. */
13393 // *****************************************************************************
13394 /* DMA System service Error
13395  Summary:
13396  Indicates the error information for the DMA System service.
13397  Description:
13398  This enumeration indicates the error information for the DMA System service.
13399  Remarks:
13400  None.
13401 */
13402 
13403 typedef
13404  enum
13405  {
13406  /* Data was transferred successfully. */
13407  SYS_DMA_ERROR_NONE /*DOM-IGNORE-BEGIN*/
13408  = 1 << 0 ,
13409  /* DOM-IGNORE-END*/
13410  /* DMA address error. */
13411  SYS_DMA_ERROR_ADDRESS_ERROR /*DOM-IGNORE-BEGIN*/
13412  = 1 << 1 /* DOM-IGNORE-END*/
13413  } SYS_DMA_ERROR ;
13414 // *****************************************************************************
13415 /* DMA Initialization data
13416  Summary:
13417  Defines the data required to initialize the DMA subsystem.
13418  Description:
13419  This data type defines the data required to initialize the DMA subsystem.
13420  Remarks:
13421  This feature may not be available on all devices. Refer to the specific device
13422  data sheet to determine availability.
13423 */
13424 
13425 typedef
13426  struct
13427  {
13428  /* Enable/Disable stop in idle mode feature */
13429  SYS_DMA_SIDL sidl ;
13430  } SYS_DMA_INIT ;
13431 // *****************************************************************************
13432 /* Data width options */
13433 
13434 typedef
13435  enum
13436  {
13437  /* Data width configuration feature is not available */
13439  } SYS_DMA_DATA_WIDTH ;
13440 // *****************************************************************************
13441 /* DMA descriptor control
13442  Summary:
13443  Defines the descriptor control for linked list operation.
13444  Description:
13445  This data type defines the descriptor control for linked list operation.
13446  Remarks:
13447  This feature may not be available on all devices. Refer to the specific device
13448  data sheet to determine availability.
13449 */
13450 
13451 typedef
13452  union
13453  {
13454  /* Feature is not supported */
13455  ;
13457 // *****************************************************************************
13458 // *****************************************************************************
13459 // Section: Initialization and Task Functions
13460 // *****************************************************************************
13461 // *****************************************************************************
13462 //******************************************************************************
13463 /* Function:
13464  void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
13465  Summary:
13466  Maintains the system service's state machine.
13467 
13468  Description:
13469  This function is used to maintain the DMA system service's internal state
13470  machine. This function services events on a specific DMA channel.
13471  Precondition:
13472  DMA should have been initialized by calling SYS_DMA_Initialize.
13473  Parameters:
13474  object - Object handle for the DMA module (returned from
13475  SYS_DMA_Initialize)
13476  activeChannel - DMA channel number to be serviced.
13477  Returns:
13478  None.
13479  Example:
13480  <code>
13481  // 'object' Returned from SYS_DMA_Initialize
13482  void __ISR(_DMA3_VECTOR,ipl5)_InterruptHandler_BT_USART_RX_DMA_CHANNEL(void)
13483  {
13484  SYS_DMA_Tasks(object, DMA_CHANNEL_3);
13485  }
13486  </code>
13487  Remarks:
13488  This function is normally not called directly by an application. It is
13489  called by the system's task/interrupt routines.
13490  */
13491 
13492 void
13493  SYS_DMA_Tasks (
13494  SYS_MODULE_OBJ object ,
13495  DMA_CHANNEL activeChannel ) ;
13496 //******************************************************************************
13497 /* For backward compatibility */
13498 #define SYS_DMA_TasksISR( object , activeChannel ) SYS_DMA_Tasks ( object , activeChannel )
13499  // #ifndef _SYS_DMA_DEFINITIONS_H
13500 /*******************************************************************************
13501  End of File
13502 */
13503 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma_definitions.h*/
13504 /* CLOSE_FILE Include File */
13505 
13506 // DOM-IGNORE-BEGIN
13507 // DOM-IGNORE-END
13508 // *****************************************************************************
13509 // *****************************************************************************
13510 // Section: DMA System Service Interface Routines
13511 // *****************************************************************************
13512 // *****************************************************************************
13513 // *****************************************************************************
13514 /* DMA System service Transfer Event Handler Function
13515  Summary:
13516  Pointer to a DMA System service Transfer Event handler function.
13517  Description:
13518  This data type defines a DMA System service Transfer Event Handler Function.
13519  A DMA system service client must register an transfer event handler function of
13520  this type to receive transfer related events from the system service.
13521  If the event is SYS_DMA_TRANSFER_EVENT_COMPLETE, this means that the data
13522  was transferred successfully. The channelHandle parameter contains the channel
13523  handle of the channel on which the transfer was processed.
13524  If the event is SYS_DMA_TRANSFER_EVENT_ERROR, this means that the data was
13525  not transferred successfully. TThe channelHandle parameter contains the channel
13526  handle of the channel on which the transfer had failed.
13527  The contextHandle parameter contains the context handle that was provided by
13528  the client at the time of registering the event handler. This context handle
13529  can be anything that the client consider helpful or necessary to identify
13530  the client context object associated with the channel of the system
13531  service that generated the event.
13532  The event handler function executes in an interrupt context when DMA is setup
13533  to start operation by an interrupt trigger source. It is recommended of the
13534  application to not perform process intensive operations with in this
13535  function.
13536  Remarks:
13537  None.
13538 */
13539 
13540 typedef
13542 SYS_DMA_CHANNEL_HANDLE handle ,
13543 uintptr_t contextHandle ) ;
13544 // *****************************************************************************
13545 // *****************************************************************************
13546 // Section: Initialization and Task Functions
13547 // *****************************************************************************
13548 // *****************************************************************************
13549 //******************************************************************************
13550 /* Function:
13551  SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT * const init)
13552  Summary:
13553  Initializes and Enables the DMA Controller.
13554  Description:
13555  This function Enables the DMA module. Enable/Disable stop in idle mode
13556  feature based on the passed parameter value.
13557  This function initializes the DMA module making it ready for clients to
13558  open and use it. The initialization data is specified by the init parameter.
13559  Precondition:
13560  None.
13561  Parameters:
13562  init - Pointer to the data structure containing any data
13563  necessary to initialize the hardware. This pointer may
13564  be null if no data is required and default
13565  initialization is to be used.
13566  Returns:
13567  If successful, returns a valid handle to the DMA module object.
13568  Otherwise, it returns SYS_MODULE_OBJ_INVALID.
13569  Example:
13570  <code>
13571  SYS_MODULE_OBJ objectHandle;
13572  SYS_DMA_INIT initParam;
13573  initParam.sidl = SYS_DMA_SIDL_ENABLE;
13574  objectHandle = SYS_DMA_Initialize(DRV_I2S_INDEX_1,
13575  (SYS_MODULE_INIT*)initParam);
13576  if (SYS_MODULE_OBJ_INVALID == objectHandle)
13577  {
13578  // Handle error
13579  }
13580  </code>
13581  Remarks:
13582  This function must be called before any other DMA systems service routines
13583  are called.
13584  Not all features are available on all micro-controllers.
13585 */
13586 
13587 SYS_MODULE_OBJ
13589  const SYS_MODULE_INIT * const init ) ;
13590 // *****************************************************************************
13591 // *****************************************************************************
13592 // Section: Channel Setup and management functions
13593 // *****************************************************************************
13594 // *****************************************************************************
13595 //******************************************************************************
13596 /* Function:
13597  SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate (DMA_CHANNEL channel)
13598  Summary:
13599  Allocates the specified DMA channel and returns a handle to it.
13600  Description:
13601  This function opens the specified DMA channel and provides a
13602  handle that must be provided to all other client-level operations to
13603  identify the caller and the DMA channel.
13604  Precondition:
13605  Function SYS_DMA_Initialize must have been called before calling this
13606  function.
13607  Parameters:
13608  channel - Channel number requested for allocation.
13609  When channel number specified is DMA_CHANNEL_ANY
13610  a random channel is allocated for DMA transfers.
13611  Returns:
13612  The channel handle for the requested channel number.
13613  If an error occurs, the return value is SYS_DMA_CHANNEL_HANDLE_INVALID.
13614  Error can occur.
13615  - if the requested channel number is invalid.
13616  - if the requested channel number is not free.
13617  Example:
13618  <code>
13619  DMA_CHANNEL channel;
13620  SYS_DMA_CHANNEL_HANDLE handle
13621  channel = DMA_CHANNEL_2;
13622  handle = SYS_DMA_ChannelAllocate(channel);
13623  if (SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
13624  {
13625  // Failed to allocate the channel
13626  }
13627  else
13628  {
13629  // Proceed with setting up the channel and adding the transfer
13630  }
13631  </code>
13632  Remarks:
13633  The handle returned is valid until the SYS_DMA_ChannelRelease routine is called.
13634  This function must be called before any other DMA channel Setup and management
13635  routines are called
13636 */
13637 
13640  DMA_CHANNEL channel ) ;
13641 //******************************************************************************
13642 /* Function:
13643  void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
13644  Summary:
13645  Deallocates and frees the channel specified by the handle.
13646  Description:
13647  This function deallocates an allocated-channel of the DMA module,
13648  invalidating the handle.
13649  Precondition:
13650  DMA should have been initialized by calling SYS_DMA_Initialize.
13651  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate
13652  Parameters:
13653  handle - A valid allocated-channel handle, returned from the service's
13654  Allocate routine
13655  Returns:
13656  None.
13657  Example:
13658  <code>
13659  DMA_CHANNEL channel;
13660  SYS_DMA_CHANNEL_HANDLE handle;
13661  channel = DMA_CHANNEL_2;
13662  handle = SYS_DMA_ChannelAllocate(channel);
13663  SYS_DMA_ChannelRelease(handle);
13664  </code>
13665  Remarks:
13666  After calling this routine, the handle passed in "handle" must not be used
13667  with any of the remaining service's routines. A new handle must be obtained by
13668  calling SYS_DMA_ChannelAllocate before the caller may use the service again
13669 */
13670 
13671 void
13673  SYS_DMA_CHANNEL_HANDLE handle ) ;
13674 //******************************************************************************
13675 /* Function:
13676  void SYS_DMA_ChannelSetup
13677  (
13678  SYS_DMA_CHANNEL_HANDLE handle,
13679  SYS_DMA_CHANNEL_OP_MODE modeEnable
13680  DMA_TRIGGER_SOURCE eventSrc
13681  )
13682  Summary:
13683  Setup the DMA channel parameters.
13684  Description:
13685  This function sets up the DMA channel parameters.
13686  It sets the channel priority and enables the mode of operations for the
13687  current system design.
13688  Precondition:
13689  DMA should have been initialized by calling SYS_DMA_Initialize.
13690  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13691  Parameters:
13692  handle - Handle of the DMA channel as returned by the
13693  SYS_DMA_ChannelAllocate function.
13694  priority - The priority to be associated to the channel.
13695  modeEnable - The supported operating modes to be enabled.
13696  This parameter can be logically ORed to specify
13697  multiple options.
13698  eventSrc - The event causing the cell transfer start.
13699  Returns:
13700  None.
13701  Example:
13702  <code>
13703  // 'handle' is a valid handle returned
13704  // by the SYS_DMA_ChannelAllocate function.
13705  SYS_DMA_CHANNEL_OP_MODE modeEnable;
13706  DMA_TRIGGER_SOURCE eventSrc;
13707  channel = DMA_CHANNEL_2;
13708  modeEnable = (SYS_DMA_CHANNEL_OP_MODE_BASIC | SYS_DMA_CHANNEL_OP_MODE_CRC);
13709  eventSrc = DMA_TRIGGER_USART_1_TRANSMIT;
13710  // Setup channel number, and enables basic and CRC mode
13711  SYS_DMA_ChannelSetup(handle, modeEnable,eventSrc);
13712  </code>
13713  Remarks:
13714  If SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT, SYS_DMA_CHANNEL_OP_MODE_CHAIN or
13715  SYS_DMA_CHANNEL_OP_MODE_CRC mode of operation is enabled, then corresponding
13716  mode setup API's needs to be called to set the related parameters.
13717  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE then
13718  SYS_DMA_ChannelForceStart must be called to start the DMA channel transfer.
13719  Not all features are available on all microcontrollers.
13720  */
13721 
13722 void
13724  SYS_DMA_CHANNEL_HANDLE handle ,
13725  SYS_DMA_CHANNEL_OP_MODE modeEnable ,
13726  DMA_TRIGGER_SOURCE eventSrc ) ;
13727 //******************************************************************************
13728 /* Function:
13729  void SYS_DMA_ChannelSetupMatchAbortMode
13730  (
13731  SYS_DMA_CHANNEL_HANDLE handle,
13732  uint16_t pattern,
13733  DMA_PATTERN_LENGTH length,
13734  SYS_DMA_CHANNEL_IGNORE_MATCH ignore,
13735  uint8_t ignorePattern
13736  )
13737  Summary:
13738  Setup the pattern match abort mode.
13739  Description:
13740  This function sets up the termination of DMA operation when the specified
13741  pattern is matched. Additionally on supported parts the function also
13742  sets up the ignoring of part of a pattern(8-bit) from match abort
13743  pattern(16-bit).
13744  Precondition:
13745  DMA should have been initialized by calling SYS_DMA_Initialize.
13746  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13747  The function SYS_DMA_ChannelSetup must be called to enable
13748  SYS_DMA_CHANNEL_OP_MODE_MATCH_ABORT before setting up pattern
13749  match mode features.
13750  Parameters:
13751  handle - Handle of the DMA channel as returned by the
13752  SYS_DMA_ChannelAllocate function.
13753  pattern - The pattern that needs to be matched to abort a DMA transfer.
13754  length - Match pattern length can be 1-byte or 2-byte.
13755  ignore - Enable/Disable a byte between a 2-byte pattern match.
13756  ignorePattern - The part of the pattern(8-bit) that needs to be ignored
13757  from the match abort pattern(16-bit)
13758  Returns:
13759  None.
13760  Example:
13761  <code>
13762  // Example 1
13763  // The following code is for a device with an 8-bit pattern value and no
13764  // support for pattern match ignore feature
13765  // 'handle' is a valid handle returned
13766  // by the SYS_DMA_ChannelAllocate function.
13767  uint16_t pattern;
13768  DMA_PATTERN_LENGTH length;
13769  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13770  uint8_t ignorePattern;
13771  pattern = 0x00; //Stop transfer on detection of a NULL character
13772  length = DMA_PATTERN_LENGTH_NONE;
13773  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_DISABLE;
13774  ignorePattern = 0;
13775  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13776  ignoreEnable, ignorePattern);
13777  // Example 2
13778  // The following code is for a device with a 16-bit pattern value and
13779  // support for pattern match ignore feature
13780  // 'handle' is a valid handle returned
13781  // by the SYS_DMA_ChannelAllocate function.
13782  uint16_t pattern;
13783  DMA_PATTERN_LENGTH length;
13784  SYS_DMA_CHANNEL_IGNORE_MATCH ignore;
13785  uint8_t ignorePattern;
13786  pattern = 0x0D0A; //Stop transfer on detection of '\r\n'
13787  length = DMA_PATTERN_MATCH_LENGTH_2BYTES;
13788  ignore = SYS_DMA_CHANNEL_IGNORE_MATCH_ENABLE;
13789  ignorePattern = 0x00; \\ Any null character between the termination pattern
13790  \\ '\r' and '\n' is ignored.
13791  SYS_DMA_ChannelSetupMatchAbortMode(handle, pattern, length,
13792  ignore, ignorePattern);
13793  </code>
13794  Remarks:
13795  The parameter 'pattern' (8-bit or 16-bit) is device-specific.
13796  Not all features are available on all devices.
13797  Refer to the specific device data sheet for details.
13798 */
13799 
13800 void
13802  SYS_DMA_CHANNEL_HANDLE handle ,
13803  uint16_t pattern ,
13804  DMA_PATTERN_LENGTH length ,
13806  uint8_t ignorePattern ) ;
13807 //******************************************************************************
13808 /* Function:
13809  void SYS_DMA_ChannelCRCSet
13810  (
13811  SYS_DMA_CHANNEL_HANDLE handle,
13812  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc
13813  )
13814  Summary:
13815  Sets up the CRC operation mode.
13816  Description:
13817  This function sets up the CRC computation features.
13818  Precondition:
13819  DMA should have been initialized by calling SYS_DMA_Initialize.
13820  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13821  The function SYS_DMA_ChannelSetup must be called to enable
13822  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13823  Parameters:
13824  handle - Handle of the DMA channel as returned by the
13825  SYS_DMA_ChannelAllocate function.
13826  crc.type - CRC will calculate an IP header checksum or an LFSR CRC.
13827  crc.mode - Compute the CRC in Background/Append mode.
13828  crc.polyLength - Denotes the length of the polynomial.
13829  crc.bitOrder - CRC is calculated LSb/MSb first.
13830  crc.byteOrder - Byte selection order input pre-CRC Generator
13831  crc.writeOrder - Write byte order selection post-CRC computation
13832  crc.data - Computed/Seed CRC
13833  crc.xorBitMask - Enable/Disable XOR bit mask on the corresponding bits
13834  when mode is LFSR
13835  Returns:
13836  None.
13837  Example:
13838  <code>
13839  //Example 1
13840  // DMA calculation using the CRC background mode
13841  // 'handle' is a valid handle returned
13842  // by the SYS_DMA_ChannelAllocate function.
13843  SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc;
13844  crc.type = DMA_CRC_LFSR;
13845  crc.mode = SYS_DMA_CHANNEL_CRC_MODE_BACKGROUND;
13846  crc.polyLength = 16;
13847  crc.bitOrder = DMA_CRC_BIT_ORDER_LSB;
13848  crc.byteOrder = DMA_CRC_BYTEORDER_NO_SWAPPING;
13849  crc.writeOrder = SYS_DMA_CRC_WRITE_ORDER_MAINTAIN;
13850  crc.data = 0xFFFF;
13851  crc.xorBitMask = 0x1021;
13852  SYS_DMA_ChannelCRCSet(handle, crc);
13853  </code>
13854  Remarks:
13855  This feature may not be available on all devices. Refer to the specific device
13856  data sheet to determine availability.
13857 */
13858 
13859 void
13861  SYS_DMA_CHANNEL_HANDLE handle ,
13863 //******************************************************************************
13864 /* Function:
13865  uint32_t SYS_DMA_ChannelCRCGet(void)
13866  Summary:
13867  Returns the computed CRC.
13868  Description:
13869  This function returns the computed CRC
13870  Precondition:
13871  DMA should have been initialized by calling SYS_DMA_Initialize.
13872  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13873  The function SYS_DMA_ChannelSetup must be called to enable
13874  SYS_DMA_CHANNEL_OP_MODE_CRC before setting up the CRC mode.
13875  The CRC generator must have been previously setup using
13876  SYS_DMA_ChannelCRCSet.
13877  Parameters:
13878  None
13879  Returns:
13880  uint32_t - The Computed CRC.
13881  Example:
13882  <code>
13883  uint32_t computedCRC;
13884  computedCRC = SYS_DMA_ChannelCRCGet();
13885  </code>
13886  Remarks:
13887  To get the computed CRC value this function must be called after the block
13888  transfer completion event (i.e., after getting and processing the callback
13889  registered with SYS_DMA_ChannelTransferEventHandlerSet).
13890  This feature may not be available on all devices. Refer to the specific device
13891  data sheet to determine availability.
13892 */
13893 
13894 uint32_t
13895  SYS_DMA_ChannelCRCGet ( void ) ;
13896 //******************************************************************************
13897 /* Function:
13898  void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
13899  Summary:
13900  Enables a channel.
13901  Description:
13902  This function enables a channel.
13903  Precondition:
13904  DMA should have been initialized by calling SYS_DMA_Initialize.
13905  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13906  The function SYS_DMA_ChannelSetup must have been called to setup and
13907  enable the required features.
13908  Parameters:
13909  handle - Handle of the DMA channel as returned by the
13910  SYS_DMA_ChannelAllocate function.
13911  Returns:
13912  None.
13913  Example:
13914  <code>
13915  // 'handle' is a valid handle returned
13916  // by the SYS_DMA_ChannelAllocate function.
13917  SYS_DMA_ChannelEnable(handle);
13918  </code>
13919  Remarks:
13920  This function may not required to be called when starting DMA setup
13921  (by SYS_DMA_ChannelSetup) and transfer Add (by SYS_DMA_ChannelTransferAdd).
13922  But may be needed to be called in the registered callback to enable the
13923  channel and continue the data transfer with the existing transfer parameters
13924  previously set with 'SYS_DMA_ChannelTransferAdd'.
13925  The DMA channel is by default disabled on the completion of block
13926  transfer(callback generated)
13927 */
13928 
13929 void
13931  SYS_DMA_CHANNEL_HANDLE handle ) ;
13932 //******************************************************************************
13933 /* Function:
13934  void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
13935  Summary:
13936  Disables a channel.
13937  Description:
13938  This function disables a channel.
13939  Precondition:
13940  DMA should have been initialized by calling SYS_DMA_Initialize.
13941  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13942  The function SYS_DMA_ChannelSetup must have been called to setup and
13943  enable the required features.
13944  A DMA channel should have been enabled either by calling
13945  'SYS_DMA_ChannelTransferAdd' or 'SYS_DMA_ChannelEnable'
13946  Parameters:
13947  handle - Handle of the DMA channel as returned by the
13948  SYS_DMA_ChannelAllocate function.
13949  Returns:
13950  None.
13951  Example:
13952  <code>
13953  // 'handle' is a valid handle returned
13954  // by the SYS_DMA_ChannelAllocate function.
13955  SYS_DMA_ChannelDisable(handle);
13956  </code>
13957  Remarks:
13958  None.
13959 */
13960 
13961 void
13963  SYS_DMA_CHANNEL_HANDLE handle ) ;
13964 //******************************************************************************
13965 /* Function:
13966  void SYS_DMA_ChannelTransferAdd
13967  (
13968  SYS_DMA_CHANNEL_HANDLE handle,
13969  const void *srcAddr, size_t srcSize
13970  const void *destAddr, size_t destSize,
13971  size_t cellSize
13972  )
13973  Summary:
13974  Adds a data transfer to a DMA channel and Enables the channel to start
13975  data transfer.
13976  Description:
13977  This function adds a data transfer characteristics for a DMA channel. The
13978  The source and the destination addresses, source and destination lengths,
13979  The number of bytes transferred per cell event are set. It also enables
13980  the channel to start data transfer.
13981  If the requesting client registered an event callback with the service,
13982  the service will issue a SYS_DMA_TRANSFER_EVENT_COMPLETE or
13983  SYS_DMA_TRANSFER_EVENT_ABORT event if the transfered was processed
13984  successfully of SYS_DMA_TRANSFER_EVENT_ERROR event if the transfer was not
13985  processed successfully.
13986  Precondition:
13987  DMA should have been initialized by calling SYS_DMA_Initialize.
13988  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
13989  The function SYS_DMA_ChannelSetup must have been called to setup and
13990  enable the required features.
13991  Parameters:
13992  handle - Handle of the DMA channel as returned by the
13993  SYS_DMA_ChannelAllocate function.
13994  srcAddr - Source of the DMA transfer
13995  srcSize - Size of the source
13996  destAddr - Destination of the DMA transfer
13997  destSize - Size of the destination
13998  cellSize - Size of the cell
13999  Returns:
14000  None.
14001  Example:
14002  <code>
14003  // Add 10 bytes of data transfer to UART TX
14004  // 'handle' is a valid handle returned
14005  // by the SYS_DMA_ChannelAllocate function.
14006  MY_APP_OBJ myAppObj;
14007  uint8_t buf[10];
14008  void *srcAddr;
14009  void *destAddr;
14010  size_t srcSize;
14011  size_t destSize;
14012  size_t cellSize;
14013  srcAddr = (uint8_t *) buf;
14014  srcSize = 10;
14015  destAddr = (uin8_t*) &U2TXREG;
14016  destSize = 1;
14017  cellSize = 1;
14018  // User registers an event handler with system service. This is done once
14019  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14020  (uintptr_t)&myAppObj);
14021  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14022  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14023  {
14024  // Error handling here
14025  }
14026  // Event Processing Technique. Event is received when
14027  // the transfer is processed.
14028  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14029  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14030  {
14031  switch(event)
14032  {
14033  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14034  // This means the data was transferred.
14035  break;
14036  case SYS_DMA_TRANSFER_EVENT_ERROR:
14037  // Error handling here.
14038  break;
14039  default:
14040  break;
14041  }
14042  }
14043  </code>
14044  Remarks:
14045  For PIC32MZ series of devices, if the source/destination addresses are
14046  RAM memory addresses, the the source/destination buffers
14047  should be made coherent to avoid the cache coherency issues.
14048  For example:
14049  <code>
14050  uint8_t buffer[1024];
14051  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14052  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14053  </code>
14054 */
14055 
14056 void
14058  SYS_DMA_CHANNEL_HANDLE handle ,
14059  const void * srcAddr ,
14060  size_t srcSize ,
14061  const void * destAddr ,
14062  size_t destSize ,
14063  size_t cellSize ) ;
14064 //******************************************************************************
14065 /* Function:
14066  void SYS_DMA_ChannelTransferSet
14067  (
14068  SYS_DMA_CHANNEL_HANDLE handle,
14069  const void *srcAddr, size_t srcSize
14070  const void *destAddr, size_t destSize,
14071  size_t cellSize
14072  )
14073  Summary:
14074  Sets up a data transfer to a DMA channel.
14075  Description:
14076  This function sets up data transfer characteristics for a DMA channel. The
14077  The source and the destination addresses, source and destination lengths,
14078  The number of bytes transferred per cell event are set.
14079  This function does not enables the DMA channel. The channel has to be explicitly
14080  enabled to start the data transfer.
14081  The above functions could be used in situations where in the user intends to
14082  setup transfer parameters but do not intend to enable the channel immediately.
14083  For example to chain to DMA channels in a cyclic order where the channels remains
14084  disabled. The channel is enabled automatically by the DMA when the transfer trigger
14085  condition occurs.
14086  Precondition:
14087  DMA should have been initialized by calling SYS_DMA_Initialize.
14088  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14089  The function SYS_DMA_ChannelSetup must have been called to setup and
14090  enable the required features.
14091  Parameters:
14092  handle - Handle of the DMA channel as returned by the
14093  SYS_DMA_ChannelAllocate function.
14094  srcAddr - Source of the DMA transfer
14095  srcSize - Size of the source
14096  destAddr - Destination of the DMA transfer
14097  destSize - Size of the destination
14098  cellSize - Size of the cell
14099  Returns:
14100  None.
14101  Example:
14102  <code>
14103  // Set up 10 bytes of data transfer to UART TX
14104  // 'handle' is a valid handle returned
14105  // by the SYS_DMA_ChannelAllocate function.
14106  MY_APP_OBJ myAppObj;
14107  uint8_t buf[10];
14108  void *srcAddr;
14109  void *destAddr;
14110  size_t srcSize;
14111  size_t destSize;
14112  size_t cellSize;
14113  srcAddr = (uint8_t *) buf;
14114  srcSize = 10;
14115  destAddr = (uin8_t*) &U2TXREG;
14116  destSize = 1;
14117  cellSize = 1;
14118  // User registers an event handler with system service. This is done once
14119  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14120  (uintptr_t)&myAppObj);
14121  SYS_DMA_ChannelTransferSet(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14122  SYS_DMA_ChannelEnable(handle);
14123  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14124  {
14125  // Error handling here
14126  }
14127  // Event Processing Technique. Event is received when
14128  // the transfer is processed.
14129  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14130  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14131  {
14132  switch(event)
14133  {
14134  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14135  // This means the data was transferred.
14136  break;
14137  case SYS_DMA_TRANSFER_EVENT_ERROR:
14138  // Error handling here.
14139  break;
14140  default:
14141  break;
14142  }
14143  }
14144  </code>
14145  Remarks:
14146  For PIC32MZ series of devices, if the source/destination addresses are
14147  RAM memory addresses, the the source/destination buffers
14148  should be made coherent to avoid the cache coherency issues.
14149  For example:
14150  <code>
14151  uint8_t buffer[1024];
14152  // The buffer can be made coherent by adding the 'coherent' attribute, as follows:
14153  uint8_t __attribute__((coherent)) __attribute__((aligned(16))) buffer[1024];
14154  </code>
14155 */
14156 
14157 void
14159  SYS_DMA_CHANNEL_HANDLE handle ,
14160  const void * srcAddr ,
14161  size_t srcSize ,
14162  const void * destAddr ,
14163  size_t destSize ,
14164  size_t cellSize ) ;
14165 //******************************************************************************
14166 /* Function:
14167  size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14168  Summary:
14169  Returns the number of bytes transferred from source.
14170  Description:
14171  When a data transfer request is submitted. At any time while the transmission
14172  is in progress the size of the amount of data transferred from source
14173  can be known by calling this function.
14174  Precondition:
14175  DMA should have been initialized by calling SYS_DMA_Initialize.
14176  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14177  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14178  SYS_DMA_ChannelTransferSet.
14179  Parameters:
14180  handle - A valid channel handle, returned from the system service's
14181  Allocate routine
14182  Returns:
14183  size_t - Returns the number of bytes transferred from the submitted size.
14184  Example:
14185  <code>
14186  // 'handle' is a valid handle returned
14187  // by the SYS_DMA_ChannelAllocate function.
14188  MY_APP_OBJ myAppObj;
14189  uint8_t buf[10];
14190  void *srcAddr;
14191  void *destAddr;
14192  size_t srcSize;
14193  size_t destSize;
14194  size_t cellSize;
14195  size_t transferredSize;
14196  srcAddr = (uint8_t *) buf;
14197  srcSize = 10;
14198  destAddr = (uin8_t*) &U2TXREG;
14199  destSize = 1;
14200  cellSize = 1;
14201  channelHandle = SYS_DMA_ChannelAllocate(channel);
14202  // User registers an event handler with system service. This is done once
14203  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14204  (uintptr_t)&myAppObj);
14205  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14206  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14207  {
14208  // Error handling here
14209  }
14210  // The data is being transferred after adding the transfer to the DMA channel.
14211  // The user can get to know dynamically the amount of data
14212  // transmitted from source by calling SYS_DMA_ChannelSourceTransferredSizeGet
14213  transferredSize = SYS_DMA_ChannelSourceTransferredSizeGet(channelHandle);
14214  </code>
14215  Remarks:
14216  None.
14217 */
14218 
14219 size_t
14221  SYS_DMA_CHANNEL_HANDLE handle ) ;
14222 //******************************************************************************
14223 /* Function:
14224  size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
14225  Summary:
14226  Returns the number of bytes transferred to destination.
14227  Description:
14228  When a data transfer request is submitted. At any time while the transmission
14229  is in progress the size of the amount of data transferred to destination
14230  can be known by calling this function.
14231  Precondition:
14232  DMA should have been initialized by calling SYS_DMA_Initialize.
14233  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14234  Data transfer should have been initiated by calling SYS_DMA_ChannelTransferAdd or
14235  SYS_DMA_ChannelTransferSet.
14236  Parameters:
14237  handle - A valid channel handle, returned from the system service's
14238  Allocate routine
14239  Returns:
14240  size_t - Returns the number of bytes received from the submitted size.
14241  Example:
14242  <code>
14243  // 'handle' is a valid handle returned
14244  // by the SYS_DMA_ChannelAllocate function.
14245  MY_APP_OBJ myAppObj;
14246  uint8_t buf[10];
14247  void *srcAddr;
14248  void *destAddr;
14249  size_t srcSize;
14250  size_t destSize;
14251  size_t cellSize;
14252  size_t transferredSize;
14253  srcAddr = (uin8_t*) &U2RXREG;
14254  srcSize = 1;
14255  destAddr = (uint8_t *) buf ;
14256  destSize = 10;
14257  cellSize = 1;
14258  channelHandle = SYS_DMA_ChannelAllocate(channel);
14259  // User registers an event handler with system service. This is done once
14260  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14261  (uintptr_t)&myAppObj);
14262  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14263  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14264  {
14265  // Error handling here
14266  }
14267  // The data is being transferred after adding the transfer to the DMA channel.
14268  // The user can get to know dynamically the amount of data
14269  // transmitted to destination by calling SYS_DMA_ChannelDestinationTransferredSizeGet
14270  transferredSize = SYS_DMA_ChannelDestinationTransferredSizeGet(channelHandle);
14271  </code>
14272  Remarks:
14273  None.
14274 */
14275 
14276 size_t
14278  SYS_DMA_CHANNEL_HANDLE handle ) ;
14279 //******************************************************************************
14280 /*
14281  Function:
14282  void SYS_DMA_ChannelTransferEventHandlerSet
14283  (
14284  SYS_DMA_CHANNEL_HANDLE handle,
14285  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler,
14286  const uintptr_t contextHandle
14287  )
14288  Summary:
14289  This function allows a DMA system service client to set an event handler.
14290  Description:
14291  This function allows a client to set an event handler. The client may want
14292  to receive transfer related events in cases when it uses non-blocking read and
14293  write functions. The event handler should be set before the client
14294  intends to perform operations that could generate events.
14295  This function accepts a contextHandle parameter. This parameter could be
14296  set by the client to contain (or point to) any client specific data object
14297  that should be associated with this DMA channel.
14298  Precondition:
14299  DMA should have been initialized by calling SYS_DMA_Initialize.
14300  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14301  Parameters:
14302  handle - A valid channel handle, returned from the system service's
14303  Allocate routine
14304  eventHandler - Pointer to the event handler function.
14305  contextHandle - Value identifying the context of the application/driver/middleware
14306  that registered the event handling function.
14307  Returns:
14308  None.
14309  Example:
14310  <code>
14311  // 'handle' is a valid handle returned
14312  // by the SYS_DMA_ChannelAllocate function.
14313  MY_APP_OBJ myAppObj;
14314  uint8_t buf[10];
14315  void *srcAddr;
14316  void *destAddr;
14317  size_t srcSize;
14318  size_t destSize;
14319  size_t cellSize;
14320  srcAddr = (uint8_t *) buf;
14321  srcSize = 10;
14322  destAddr = (uin8_t*) &U2TXREG;
14323  destSize = 1;
14324  cellSize = 1;
14325  channelHandle = SYS_DMA_ChannelAllocate(channel);
14326  // User registers an event handler with system service. This is done once
14327  SYS_DMA_ChannelTransferEventHandlerSet(handle, APP_DMASYSTransferEventHandler,
14328  (uintptr_t)&myAppObj);
14329  SYS_DMA_ChannelTransferAdd(handle,srcAddr,srcSize,destAddr,destSize,cellSize);
14330  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14331  {
14332  // Error handling here
14333  }
14334  // Event Processing Technique. Event is received when
14335  // the transfer is processed.
14336  void APP_DMASYSTransferEventHandler(SYS_DMA_TRANSFER_EVENT event,
14337  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
14338  {
14339  switch(event)
14340  {
14341  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14342  // This means the data was transferred.
14343  break;
14344  case SYS_DMA_TRANSFER_EVENT_ERROR:
14345  // Error handling here.
14346  break;
14347  default:
14348  break;
14349  }
14350  }
14351  </code>
14352  Remarks:
14353  None.
14354  */
14355 
14356 void
14358  SYS_DMA_CHANNEL_HANDLE handle ,
14359  const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler ,
14360  const uintptr_t contextHandle ) ;
14361 // *****************************************************************************
14362 /* Function:
14363  SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
14364  Summary:
14365  This function returns the error(if any) associated with the last client
14366  request.
14367  Description:
14368  This function returns the error(if any) associated with the last client
14369  request. If the service send a SYS_DMA_TRANSFER_EVENT_ERROR to the client,
14370  the client can call this function to know the error cause.
14371  The error status will be updated on every operation and should be read
14372  frequently (ideally immediately after the service operation has completed)
14373  to know the relevant error status.
14374  Precondition:
14375  The SYS_DMA_Initialize routine must have been called for the DMA sub system.
14376  SYS_DMA_ChannelAllocate must have been called to obtain a valid opened channel
14377  handle.
14378  Parameters:
14379  handle - Handle of the DMA channel as returned by the
14380  SYS_DMA_ChannelAllocate function.
14381  Returns:
14382  A SYS_DMA_ERROR type indicating last known error status.
14383  Example:
14384  <code>
14385  // 'handle' is a valid handle returned
14386  // by the SYS_DMA_ChannelAllocate function.
14387  // pDmaSrc, pDmaDst is the source,destination address
14388  // txferSrcSize, txferDesSize is the source,destination transfer size
14389  // cellSize is the cell size
14390  MY_APP_OBJ myAppObj;
14391  // Client registers an event handler with service. This is done once
14392  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14393  (uintptr_t)&myAppObj );
14394  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14395  DMA_TRIGGER_SOURCE_NONE);
14396  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14397  pDmaDst,txferDesSize,cellSize);
14398  SYS_DMA_ChannelForceStart(handle);
14399  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14400  {
14401  // Error handling here
14402  }
14403  // Event Processing Technique. Event is received when
14404  // the transfer is processed.
14405  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14406  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14407  {
14408  switch(event)
14409  {
14410  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14411  // This means the data was transferred.
14412  break;
14413  case SYS_DMA_TRANSFER_EVENT_ERROR:
14414  // Error handling here.
14415  if(SYS_DMA_ERROR_ADDRESS_ERROR == SYS_DMA_ChannelErrorGet(handle))
14416  {
14417  // There was an address error.
14418  // Do error handling here.
14419  }
14420  break;
14421  default:
14422  break;
14423  }
14424  }
14425  </code>
14426  Remarks:
14427  It is the client's responsibility to make sure that the error status is
14428  obtained frequently. The service will update the error status
14429  regardless of whether this has been examined by the client.
14430 */
14431 
14434  SYS_DMA_CHANNEL_HANDLE handle ) ;
14435 //******************************************************************************
14436 /* Function:
14437  void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
14438  Summary:
14439  Force start of transfer on the selected channel.
14440  Description:
14441  The function force start a DMA transfer to occur for the selected channel.
14442  Precondition:
14443  DMA should have been initialized by calling SYS_DMA_Initialize.
14444  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14445  The function SYS_DMA_ChannelSetup must have been called to setup and
14446  enable the required features.
14447  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14448  Parameters:
14449  handle - Handle of the DMA channel as returned by the
14450  SYS_DMA_ChannelAllocate function.
14451  Returns:
14452  None.
14453  Example:
14454  <code>
14455  // 'handle' is a valid handle returned
14456  // by the SYS_DMA_ChannelAllocate function.
14457  // pDmaSrc, pDmaDst is the source,destination address
14458  // txferSrcSize, txferDesSize is the source,destination transfer size
14459  // cellSize is the cell size
14460  MY_APP_OBJ myAppObj;
14461  // Client registers an event handler with service. This is done once
14462  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14463  (uintptr_t)&myAppObj );
14464  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14465  DMA_TRIGGER_SOURCE_NONE);
14466  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14467  pDmaDst,txferDesSize,cellSize);
14468  SYS_DMA_ChannelForceStart(handle);
14469  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14470  {
14471  // Error handling here
14472  }
14473  // Event Processing Technique. Event is received when
14474  // the transfer is processed.
14475  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14476  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14477  {
14478  switch(event)
14479  {
14480  case SYS_DMA_TRANSFER_EVENT_COMPLETE:
14481  // This means the data was transferred.
14482  break;
14483  case SYS_DMA_TRANSFER_EVENT_ERROR:
14484  // Error handling here.
14485  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14486  {
14487  // There was an address error.
14488  // Do error handling here.
14489  }
14490  break;
14491  default:
14492  break;
14493  }
14494  }
14495  </code>
14496  Remarks:
14497  This function must be used to start the DMA transfer when the channel has been
14498  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14499 */
14500 
14501 void
14503  SYS_DMA_CHANNEL_HANDLE handle ) ;
14504 //******************************************************************************
14505 /* Function:
14506  void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
14507  Summary:
14508  Force abort of transfer on the selected channel.
14509  Description:
14510  The function aborts a DMA transfer to occur for the selected channel.
14511  Precondition:
14512  DMA should have been initialized by calling SYS_DMA_Initialize.
14513  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14514  The function SYS_DMA_ChannelSetup must have been called to setup and
14515  enable the required features.
14516  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14517  Parameters:
14518  handle - Handle of the DMA channel as returned by the
14519  SYS_DMA_ChannelAllocate function.
14520  Returns:
14521  None.
14522  Example:
14523  <code>
14524  // 'handle' is a valid handle returned
14525  // by the SYS_DMA_ChannelAllocate function.
14526  // pDmaSrc, pDmaDst is the source,destination address
14527  // txferSrcSize, txferDesSize is the source,destination transfer size
14528  // cellSize is the cell size
14529  MY_APP_OBJ myAppObj;
14530  // Client registers an event handler with service. This is done once
14531  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14532  (uintptr_t)&myAppObj );
14533  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14534  DMA_TRIGGER_SOURCE_NONE);
14535  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14536  pDmaDst,txferDesSize,cellSize);
14537  SYS_DMA_ChannelForceStart(handle);
14538  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14539  {
14540  // Error handling here
14541  }
14542  ....
14543  ....
14544  // Client may need to abort a transfer
14545  SYS_DMA_ChannelForceAbort(handle);
14546  // Event Processing Technique. Event is received when
14547  // the transfer is processed.
14548  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14549  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14550  {
14551  switch(event)
14552  {
14553  case SYS_DMA_TRANSFER_EVENT_ABORT:
14554  // This means the data was transferred.
14555  break;
14556  case SYS_DMA_TRANSFER_EVENT_ERROR:
14557  // Error handling here.
14558  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14559  {
14560  // There was an address error.
14561  // Do error handling here.
14562  }
14563  break;
14564  default:
14565  break;
14566  }
14567  }
14568  </code>
14569  Remarks:
14570  This function must be used to abort the DMA transfer when the channel has been
14571  setup(by calling SYS_DMA_ChannelSetup) with the eventSrc as DMA_TRIGGER_SOURCE_NONE.
14572  and SYS_DMA_ChannelAbortEventSet has not been called.
14573 */
14574 
14575 void
14577  SYS_DMA_CHANNEL_HANDLE handle ) ;
14578 //******************************************************************************
14579 /* Function:
14580  void SYS_DMA_ChannelAbortEventSet
14581  (
14582  SYS_DMA_CHANNEL_HANDLE handle,
14583  DMA_TRIGGER_SOURCE eventSrc
14584  )
14585  Summary:
14586  Sets an event source and enables cell transfer abort event for the same
14587  for the selected channel.
14588  Description:
14589  This functions enables a cell transfer abort event for the selected source
14590  event.
14591  Precondition:
14592  DMA should have been initialized by calling SYS_DMA_Initialize.
14593  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14594  The function SYS_DMA_ChannelSetup must have been called to setup and
14595  enable the required features.
14596  The function 'SYS_DMA_ChannelTransferAdd' to add a transfer.
14597  Parameters:
14598  handle - Handle of the DMA channel as returned by the
14599  SYS_DMA_ChannelAllocate function.
14600  eventSrc - The event causing the cell transfer abort
14601  Returns:
14602  None.
14603  Example:
14604  <code>
14605  // 'handle' is a valid handle returned
14606  // by the SYS_DMA_ChannelAllocate function.
14607  // pDmaSrc, pDmaDst is the source,destination address
14608  // txferSrcSize, txferDesSize is the source,destination transfer size
14609  // cellSize is the cell size
14610  MY_APP_OBJ myAppObj;
14611  // Client registers an event handler with service. This is done once
14612  SYS_DMA_ChannelTransferEventHandlerSet( handle, APP_DMATransferEventHandle,
14613  (uintptr_t)&myAppObj );
14614  SYS_DMA_ChannelSetup(handle, SYS_DMA_CHANNEL_OP_MODE_BASIC,
14615  DMA_TRIGGER_SOURCE_NONE);
14616  SYS_DMA_ChannelTransferAdd(handle,pDmaSrc,txferSrcSize,
14617  pDmaDst,txferDesSize,cellSize);
14618  SYS_DMA_ChannelAbortEventSet(handle, DMA_TRIGGER_CTMU);
14619  SYS_DMA_ChannelForceStart(handle);
14620  if(SYS_DMA_CHANNEL_HANDLE_INVALID == handle)
14621  {
14622  // Error handling here
14623  }
14624  // Event Processing Technique. Event is received when
14625  // the transfer is processed.
14626  void APP_DMATransferEventHandle( SYS_DMA_TRANSFER_EVENT event,
14627  SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle )
14628  {
14629  switch(event)
14630  {
14631  case SYS_DMA_TRANSFER_EVENT_ABORT:
14632  // This means the data was transferred.
14633  break;
14634  case SYS_DMA_TRANSFER_EVENT_ERROR:
14635  // Error handling here.
14636  if(SYS_DMA_ERROR_ADDRESS_ERROR == DRV_I2S_ErrorGet(myI2SHandle))
14637  {
14638  // There was an address error.
14639  // Do error handling here.
14640  }
14641  break;
14642  default:
14643  break;
14644  }
14645  }
14646  </code>
14647  Remarks:
14648  If the parameter 'eventSrc' is specified as DMA_TRIGGER_SOURCE_NONE the
14649  current DMA transfer will be aborted. The behavior is a same as calling
14650  SYS_DMA_ChannelForceAbort.
14651 */
14652 
14653 void
14655  SYS_DMA_CHANNEL_HANDLE handle ,
14656  DMA_TRIGGER_SOURCE eventSrc ) ;
14657 //******************************************************************************
14658 /* Function:
14659  bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
14660  Summary:
14661  Returns the busy status of the specified DMA channel.
14662  Description:
14663  This function returns the busy status of the selected DMA channel
14664  Precondition:
14665  DMA should have been initialized by calling SYS_DMA_Initialize.
14666  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14667  Parameters:
14668  handle - Handle of the DMA channel as returned by the
14669  SYS_DMA_ChannelAllocate function.
14670  Returns:
14671  bool - true, if the selected DMA channel is active or enabled
14672  - false, if the selected DMA channel is inactive or disabled
14673  Example:
14674  <code>
14675  bool busyStat;
14676  busyStat = SYS_DMA_ChannelGetBusy(handle);
14677  </code>
14678  Remarks:
14679  This feature may not be available on all devices. Refer to the specific device
14680  data sheet to determine availability.
14681 */
14682 
14683 bool
14685  SYS_DMA_CHANNEL_HANDLE handle ) ;
14686 //******************************************************************************
14687 /* Function:
14688  void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
14689  Summary:
14690  Suspend DMA operation on the specified DMA channel.
14691  Description:
14692  This function suspends the DMA operation on the DMA channel
14693  specified by the channel handle.
14694  Precondition:
14695  DMA should have been initialized by calling SYS_DMA_Initialize.
14696  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14697  Parameters:
14698  handle - Handle of the DMA channel as returned by the
14699  SYS_DMA_ChannelAllocate function.
14700  Returns:
14701  None.
14702  Example:
14703  <code>
14704  SYS_DMA_ChannelSuspend(handle);
14705  </code>
14706  Remarks:
14707  This feature may not be available on all devices. Refer to the specific device
14708  data sheet to determine availability.
14709 */
14710 
14711 void
14713  SYS_DMA_CHANNEL_HANDLE handle ) ;
14714 //******************************************************************************
14715 /* Function:
14716  void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
14717  Summary:
14718  Resume DMA operation on the specified DMA channel.
14719  Description:
14720  This function resumes the DMA operation on the DMA channel
14721  specified by the channel handle.
14722  Precondition:
14723  DMA should have been initialized by calling SYS_DMA_Initialize.
14724  DMA channel should have been allocated by calling SYS_DMA_ChannelAllocate.
14725  Parameters:
14726  handle - Handle of the DMA channel as returned by the
14727  SYS_DMA_ChannelAllocate function.
14728  Returns:
14729  None.
14730  Example:
14731  <code>
14732  SYS_DMA_ChannelResume(handle);
14733  </code>
14734  Remarks:
14735  This feature may not be available on all devices. Refer to the specific device
14736  data sheet to determine availability.
14737 */
14738 
14739 void
14741  SYS_DMA_CHANNEL_HANDLE handle ) ;
14742 // *****************************************************************************
14743 // *****************************************************************************
14744 // Section: Global DMA Management Functions
14745 // *****************************************************************************
14746 // *****************************************************************************
14747 //******************************************************************************
14748 /* Function:
14749  void SYS_DMA_Suspend(void)
14750  Summary:
14751  Suspend DMA transfers.
14752  Description:
14753  This function suspends DMA transfers to allow CPU uninterrupted access
14754  to data bus
14755  Precondition:
14756  DMA should have been initialized by calling SYS_DMA_Initialize.
14757  Parameters:
14758  None.
14759  Returns:
14760  None.
14761  Example:
14762  <code>
14763  SYS_DMA_Suspend();
14764  </code>
14765  Remarks:
14766  None
14767 */
14768 
14769 void
14770  SYS_DMA_Suspend ( void ) ;
14771 //******************************************************************************
14772 /* Function:
14773  void SYS_DMA_Resume(void)
14774  Summary:
14775  Resume DMA operations.
14776  Description:
14777  This function disables DMA suspend. It resumes the DMA operation suspended
14778  by calling SYS_DMA_Suspend. The DMA operates normally.
14779  Precondition:
14780  DMA should have been initialized by calling SYS_DMA_Initialize.
14781  Parameters:
14782  None.
14783  Returns:
14784  None.
14785  Example:
14786  <code>
14787  SYS_DMA_Resume();
14788  </code>
14789  Remarks:
14790  None
14791 */
14792 
14793 void
14794  SYS_DMA_Resume ( void ) ;
14795 //******************************************************************************
14796 /* Function:
14797  bool SYS_DMA_IsBusy(void)
14798  Summary:
14799  Returns the busy status of the DMA module.
14800  Description:
14801  This function returns the busy status of the DMA module
14802  Precondition:
14803  DMA should have been initialized by calling SYS_DMA_Initialize.
14804  Parameters:
14805  None.
14806  Returns:
14807  Boolean
14808  - true - The DMA module is active
14809  - false - The DMA module is inactive and disabled
14810  <code>
14811  bool busyStat;
14812  busyStat = SYS_DMA_IsBusy();
14813  </code>
14814  Remarks:
14815  This feature may not be available on all devices. Refer to the specific device
14816  data sheet to determine availability.
14817 */
14818 
14819 bool
14820  SYS_DMA_IsBusy ( void ) ;
14821 // *****************************************************************************
14822 // *****************************************************************************
14823 // Section: Deprecated functions
14824 // *****************************************************************************
14825 // *****************************************************************************
14826 //*******************************************************************************
14827 /* Function:
14828  void SYS_DMA_TasksISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14829  Summary:
14830  This function is deprecated. Use SYS_DMA_Tasks function.
14831  */
14832 
14833 void
14834  SYS_DMA_Tasks (
14835  SYS_MODULE_OBJ object ,
14836  DMA_CHANNEL activeChannel ) ;
14837 //*****************************************************************************
14838 /* Function:
14839  void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
14840  Summary:
14841  This function is deprecated. Use SYS_DMA_Tasks function.
14842  */
14843 
14844 void
14846  SYS_MODULE_OBJ object ) ;
14847 //*******************************************************************************
14848 /* Function:
14849  void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
14850  Summary:
14851  This function is deprecated. Use SYS_DMA_Tasks function.
14852  */
14853 
14854 void
14856  SYS_MODULE_OBJ object ,
14857  DMA_CHANNEL activeChannel ) ;
14858  // #ifndef _SYS_DMA_H
14859 /*******************************************************************************
14860  End of File
14861 */
14862 
14863 #endif /*00 C:\microchip\harmony\v2_06\framework\system\dma\sys_dma.h*/
14864 /* CLOSE_FILE Include File */
14865 
14866 // DOM-IGNORE-BEGIN
14867 // DOM-IGNORE-END
14868 // *****************************************************************************
14869 // *****************************************************************************
14870 // Section: Data Types
14871 // *****************************************************************************
14872 // *****************************************************************************
14873 // *****************************************************************************
14874 /* Driver USART Module Index
14875  Summary:
14876  USART driver index definitions
14877  Description:
14878  These constants provide USART driver index definitions.
14879  Remarks:
14880  These constants should be used in place of hard-coded numeric literals.
14881  These values should be passed into the DRV_USART_Initialize and
14882  DRV_USART_Open routines to identify the driver instance in use.
14883 */
14884 #define DRV_USART_INDEX_0 0
14885 #define DRV_USART_INDEX_1 1
14886 #define DRV_USART_INDEX_2 2
14887 #define DRV_USART_INDEX_3 3
14888 #define DRV_USART_INDEX_4 4
14889 #define DRV_USART_INDEX_5 5
14890 // *****************************************************************************
14891 /* USART Driver Module Count
14892  Summary:
14893  Number of valid USART drivers
14894  Description:
14895  This constant identifies the maximum number of USART Driver instances that
14896  should be defined in the system. Defining more instances than this
14897  constant will waste RAM memory space.
14898  This constant can also be used by the system and application to identify the
14899  number of USART instances on this microcontroller.
14900  Remarks:
14901  This value is part-specific.
14902 */
14903 #define DRV_USART_COUNT USART_NUMBER_OF_MODULES
14904 // *****************************************************************************
14905 /* USART Driver Write Error
14906  Summary:
14907  USART Driver Write Error.
14908  Description:
14909  This constant is returned by DRV_USART_Write() function when an error
14910  occurs.
14911  Remarks:
14912  None.
14913 */
14914 #define DRV_USART_WRITE_ERROR ( ( uint32_t ) ( - 1 ) )
14915 // *****************************************************************************
14916 /* USART Driver Read Error
14917  Summary:
14918  USART Driver Read Error.
14919  Description:
14920  This constant is returned by DRV_USART_Read() function when an error
14921  occurs.
14922  Remarks:
14923  None.
14924 */
14925 #define DRV_USART_READ_ERROR ( ( uint32_t ) ( - 1 ) )
14926 // *****************************************************************************
14927 /* USART Driver Buffer Handle
14928  Summary:
14929  Handle identifying a read or write buffer passed to the driver.
14930  Description:
14931  A buffer handle value is returned by a call to the DRV_USART_BufferAddRead
14932  or DRV_USART_BufferAddWrite functions. This handle is associated with the
14933  buffer passed into the function and it allows the application to track the
14934  completion of the data from (or into) that buffer. The buffer handle value
14935  returned from the "buffer add" function is returned back to the client
14936  by the "event handler callback" function registered with the driver.
14937  The buffer handle assigned to a client request expires when the client has
14938  been notified of the completion of the buffer transfer (after event handler
14939  function that notifies the client returns) or after the buffer has been
14940  retired by the driver if no event handler callback was set.
14941  Remarks:
14942  None
14943 */
14944 
14945 typedef
14946 uintptr_t
14948 // *****************************************************************************
14949 /* USART Driver Invalid Buffer Handle
14950  Summary:
14951  Definition of an invalid buffer handle.
14952  Description:
14953  This is the definition of an invalid buffer handle. An invalid buffer handle
14954  is returned by DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite
14955  functions if the buffer add request was not successful.
14956  Remarks:
14957  None
14958 */
14959 #define DRV_USART_BUFFER_HANDLE_INVALID ( ( DRV_USART_BUFFER_HANDLE ) ( - 1 ) )
14960 // *****************************************************************************
14961 /* USART Modes of Operation
14962  Summary:
14963  Identifies the modes of the operation of the USART module
14964  Description:
14965  This data type identifies the modes of the operation of the USART module.
14966  Remarks:
14967  Not all modes are available on all devices. Refer to the specific device data
14968  sheet to determine availability.
14969 */
14970 
14971 typedef
14972  enum
14973  {
14974  /* USART works in IRDA mode */
14976  /* This is the normal point to point communication mode where the USART
14977  communicates directly with another USART by connecting it's Transmit signal
14978  to the external USART's Receiver signal and vice versa. An external
14979  transceiver may be connected to obtain RS-232 signal levels. This type of
14980  connection is typically full duplex. */
14982  /* This is a multi-point bus mode where the USART can communicate with
14983  many other USARTS on a bus using an address-based protocol such as RS-485.
14984  This mode is typically half duplex and the physical layer may require a
14985  transceiver. In this mode every USART on the bus is assigned an address and
14986  the number of data bits is 9 bits */
14988  /* Loopback mode internally connects the Transmit signal to the Receiver
14989  signal, looping data transmission back into this USART's own input. It is
14990  useful primarily as a test mode. */
14993 // *****************************************************************************
14994 /* USART Driver Buffer Events
14995  Summary
14996  Identifies the possible events that can result from a buffer add request.
14997  Description
14998  This enumeration identifies the possible events that can result from a
14999  buffer add request caused by the client calling either the
15000  DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite functions.
15001  Remarks:
15002  One of these values is passed in the "event" parameter of the event
15003  handling callback function that the client registered with the driver by
15004  calling the DRV_USART_BufferEventHandlerSet function when a buffer
15005  transfer request is completed.
15006 */
15007 
15008 typedef
15009  enum
15010  {
15011  /* All data from or to the buffer was transferred successfully. */
15013  /* There was an error while processing the buffer transfer request. */
15015  /* Data transfer aborted (Applicable in DMA mode) */
15018 // *****************************************************************************
15019 /* USART Driver Buffer Result
15020  Summary
15021  Identifies the possible result of the buffer processing.
15022  Description
15023  This enumeration identifies the possible result of the buffer processing.
15024 
15025  Remarks:
15026  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED is the state of the buffer which
15027  is in the free buffer pool.
15028 */
15029 
15030 typedef
15031  enum
15032  {
15033  /* Buffer handle is not valid*/
15035  /* Buffer handle has expired. */
15037  /* Buffer is removed from the queue succesfully*/
15039  /* Buffer removal failed because of unable to acquire the mutex
15040  * This is applicable in RTOS mode only */
15043 // *****************************************************************************
15044 /* USART Driver Buffer Event Handler Function Pointer
15045  Summary
15046  Pointer to a USART Driver Buffer Event handler function
15047  Description
15048  This data type defines the required function signature for the USART driver
15049  buffer event handling callback function. A client must register a pointer
15050  to a buffer event handling function whose function signature (parameter
15051  and return value types) match the types specified by this function pointer
15052  in order to receive buffer related event calls back from the driver.
15053  The parameters and return values and are described here and
15054  a partial example implementation is provided.
15055  Parameters:
15056  event - Identifies the type of event
15057  bufferHandle - Handle identifying the buffer to which the vent relates
15058  context - Value identifying the context of the application that registered
15059  the event handling function.
15060  Returns:
15061  None.
15062  Example:
15063  <code>
15064  void APP_MyBufferEventHandler( DRV_USART_BUFFER_EVENT event,
15065  DRV_USART_BUFFER_HANDLE bufferHandle,
15066  uintptr_t context )
15067  {
15068  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
15069  switch(event)
15070  {
15071  case DRV_USART_BUFFER_EVENT_COMPLETE:
15072  // Handle the completed buffer.
15073  break;
15074  case DRV_USART_BUFFER_EVENT_ERROR:
15075  default:
15076  // Handle error.
15077  break;
15078  }
15079  }
15080  </code>
15081  Remarks:
15082  If the event is DRV_USART_BUFFER_EVENT_COMPLETE, it means that the data was
15083  transferred successfully.
15084  If the event is DRV_USART_BUFFER_EVENT_ERROR, it means that the data was not
15085  transferred successfully. The DRV_USART_ErrorGet function can be called to
15086  know the error. The DRV_USART_BufferCompletedBytesGet function can be
15087  called to find out how many bytes were processed.
15088  The bufferHandle parameter contains the buffer handle of the buffer that
15089  associated with the event.
15090  The context parameter contains the a handle to the client context,
15091  provided at the time the event handling function was registered using the
15092  DRV_USART_BufferEventHandlerSet function. This context handle value is
15093  passed back to the client as the "context" parameter. It can be any value
15094  necessary to identify the client context or instance (such as a pointer to
15095  the client's data) instance of the client that made the buffer add request.
15096  The event handler function executes in the driver peripheral's interrupt
15097  context when the driver is configured for interrupt mode operation. It is
15098  recommended of the application to not perform process intensive or blocking
15099  operations with in this function.
15100  The DRV_USART_BufferAddRead and DRV_USART_BufferAddWrite functions can
15101  be called in the event handler to add a buffer to the driver queue. These
15102  functions can only be called to add buffers to the driver whose event
15103  handler is running. For example, buffers cannot be added USART2 driver in
15104  USART1 driver event handler.
15105 */
15106 
15107 typedef
15109 DRV_USART_BUFFER_HANDLE bufferHandle ,
15110 uintptr_t context ) ;
15111 // *****************************************************************************
15112 /* USART Driver Byte Event Handler Function Pointer
15113  Summary
15114  Pointer to a USART Driver Byte Event handler function
15115  Description
15116  This data type defines the required function signature for the USART driver
15117  byte event handling callback function. A client must register a pointer to a
15118  byte event handling function whose function signature (parameter and return
15119  value types) match the types specified by this function pointer in order to
15120  receive byte related event calls back from the driver.
15121  Parameters:
15122  index - Identifier for the instance
15123  Returns:
15124  None.
15125  Example:
15126  <code>
15127  void APP_MyUsartTxEventHandler(void)
15128  {
15129  // Handle the transmit byte event
15130  }
15131  </code>
15132  Remarks:
15133  The event handler function executes in the driver peripheral's interrupt
15134  context when the driver is configured for interrupt mode operation. It is
15135  recommended that the application not perform process intensive or blocking
15136  operations with in this function.
15137 */
15138 
15139 typedef
15140 void ( * DRV_USART_BYTE_EVENT_HANDLER ) ( const SYS_MODULE_INDEX index ) ;
15141 // *****************************************************************************
15142 /* USART Handshake Modes
15143  Summary:
15144  Identifies the handshaking modes supported by the USART driver.
15145  Description:
15146  This data type identifies the handshaking modes supported by the USART
15147  driver.
15148  Remarks:
15149  Not all modes are available on all devices. Refer to the specific device data
15150  sheet to determine availability.
15151 */
15152 
15153 typedef
15154  enum
15155  {
15156  /* Handshaking occurs in Flow Control Mode */
15157  DRV_USART_HANDSHAKE_FLOWCONTROL = /*DOM-IGNORE-BEGIN*/
15158  USART_HANDSHAKE_MODE_FLOW_CONTROL /*DOM-IGNORE-END*/
15159  ,
15160  /* Handshaking occurs in Simplex Mode */
15161  DRV_USART_HANDSHAKE_SIMPLEX = /*DOM-IGNORE-BEGIN*/
15162  USART_HANDSHAKE_MODE_SIMPLEX /*DOM-IGNORE-END*/
15163  ,
15164  /* No Handshaking */
15165  DRV_USART_HANDSHAKE_NONE = /*DOM-IGNORE-BEGIN*/
15166  2 /*DOM-IGNORE-END*/
15168 // *****************************************************************************
15169 /* USART Baud Set Result
15170  Summary:
15171  Identifies the results of the baud set function.
15172  Description:
15173  This data type identifies the results of the DRV_USART_BaudSet function.
15174  Remarks:
15175  None.
15176 */
15177 
15178 typedef
15179  enum
15180  {
15181  /* The driver was not able to change the baud */
15182  DRV_USART_BAUD_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15183  - 1 /*DOM-IGNORE-END*/
15184  ,
15185  /* The driver was able to change the baud successfully */
15188 // *****************************************************************************
15189 /* USART Line Control Set Result
15190  Summary:
15191  Identifies the results of the baud set function.
15192  Description:
15193  This data type identifies the results of the DRV_USART_LineControlSet
15194  function.
15195  Remarks:
15196  None.
15197 */
15198 
15199 typedef
15200  enum
15201  {
15202  /* The driver was not able to change the Line Control */
15203  DRV_USART_LINE_CONTROL_SET_ERROR = /*DOM-IGNORE-BEGIN*/
15204  - 1 /*DOM-IGNORE-END*/
15205  ,
15206  /* The driver was able to change the Line Control successfully */
15209 // *****************************************************************************
15210 /* USART Line Control Modes
15211  Summary:
15212  Identifies the line control modes supported by the USART driver.
15213  Description:
15214  This data type identifies the line control modes supported by the USART
15215  driver. Line control modes define the number of data bits, parity mode, and
15216  the number of stop bits in a USART transmit and receive frames.
15217  Remarks:
15218  The abbreviations used in the labels for the values of this enumeration
15219  follow the format <data><parity><stop>, where:
15220  <data> is the number of data bits
15221  <parity> is either "NONE" (for no parity), "EVEN" for 1 parity bit
15222  added to obtain an even number of bits, or "ODD" for one bit
15223  added to obtain an odd number of bits.
15224  <stop> is the number of Stop bits
15225 */
15226 
15227 typedef
15228  enum
15229  {
15230  /* 8 data bits, no parity bit, 1 stop bit */
15231  DRV_USART_LINE_CONTROL_8NONE1 = /*DOM-IGNORE-BEGIN*/
15232  USART_8N1 /* DOM-IGNORE-END*/
15233  ,
15234  /* 9 data bits, no parity bit, 1 stop bit */
15235  DRV_USART_LINE_CONTROL_9NONE1 = /*DOM-IGNORE-BEGIN*/
15236  USART_9N1 /* DOM-IGNORE-END*/
15237  ,
15238  /* 8 data bits, 1 bit for even parity, 1 stop bit */
15239  DRV_USART_LINE_CONTROL_8EVEN1 = /*DOM-IGNORE-BEGIN*/
15240  USART_8E1 /* DOM-IGNORE-END*/
15241  ,
15242  /* 8 data bits, 1 bit for even parity, 2 stop bits */
15243  DRV_USART_LINE_CONTROL_8EVEN2 = /*DOM-IGNORE-BEGIN*/
15244  USART_8E2 /* DOM-IGNORE-END*/
15245  ,
15246  /* 8 data bits, 1 bit for odd parity, 1 stop bit */
15247  DRV_USART_LINE_CONTROL_8ODD1 = /*DOM-IGNORE-BEGIN*/
15248  USART_8O1 /* DOM-IGNORE-END*/
15249  ,
15250  /* 8 data bits, 1 bit for odd parity, 2 stop bits */
15251  DRV_USART_LINE_CONTROL_8ODD2 = /*DOM-IGNORE-BEGIN*/
15252  USART_8O2 /* DOM-IGNORE-END*/
15253  ,
15254  /* 8 data bits, no parity bit, 2 stop bit */
15255  DRV_USART_LINE_CONTROL_8NONE2 = /*DOM-IGNORE-BEGIN*/
15256  USART_8N2 /* DOM-IGNORE-END*/
15257  ,
15258  /* 9 data bits, no parity bit, 2 stop bit */
15259  DRV_USART_LINE_CONTROL_9NONE2 = /*DOM-IGNORE-BEGIN*/
15260  USART_9N2 /* DOM-IGNORE-END*/
15262 // *****************************************************************************
15263 /* USART Initialization flags
15264  Summary:
15265  Flags identifying features that can be enabled when the driver is
15266  initialized.
15267  Description:
15268  This enumeration defines flags identifying features that can be enabled
15269  when the driver is initialized.
15270  Remarks:
15271  These flags can be logically ORed together. They are passed into the
15272  DRV_USART_Initialize function through the "flags" member of the
15273  DRV_USART_INIT structure.
15274 */
15275 
15276 typedef
15277  enum
15278  {
15279  /* Use this if no flags need to be set */
15280  DRV_USART_INIT_FLAG_NONE = /* DOM-IGNORE-BEGIN */
15281  0 /*DOM-IGNORE-END*/
15282  ,
15283  /* Flag to enable "wake on start" operation. If supported and enabled,
15284  this feature will allow the USART to wake-up the device when a
15285  Start bit is received. This option should be selected only when the
15286  device is to placed in Sleep mode. Note that enabling this bit will
15287  also cause the first received character to be lost. Refer to the specific
15288  device data sheet for more information. */
15290  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15291  ,
15292  /* Flag to enable auto baud detection. If supported and enabled, this
15293  feature will allow the USART to automatically detect the baud rate in
15294  use. */
15295  DRV_USART_INIT_FLAG_AUTO_BAUD/*DOM-IGNORE-BEGIN*/
15296  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15297  ,
15298  /* Flag to enable stop in idle. If supported and enabled , this
15299  feature will allow the USART to stop when the CPU enters Idle
15300  mode */
15302  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15304 // *****************************************************************************
15305 /* Operation Mode Initialization Data
15306  Summary:
15307  Defines the initialization data required for different operation modes of
15308  USART.
15309  Description:
15310  This data type defines the initialization data required for different
15311  operation modes of the USART.
15312  Remarks:
15313  None
15314 */
15315 
15316 typedef
15317  union
15318  {
15319  /* Initialization for Addressed mode */
15320  struct
15321  {
15322  /* Address of the device. */
15323  uint8_t address ;
15324  } AddressedModeInit ;
15326 // *****************************************************************************
15327 /* USART Driver Errors.
15328  Summary:
15329  Defines the possible errors that can occur during driver operation.
15330  Description:
15331  This data type defines the possible errors that can occur when occur during
15332  USART driver operation. These values are returned by DRV_USART_ErrorGet
15333  function.
15334  Remarks:
15335  None
15336 */
15337 
15338 typedef
15339  enum
15340  {
15341  /* There was no error */
15343  /*DOM-IGNORE-BEGIN*/
15344  = USART_ERROR_NONE /*DOM-IGNORE-END*/
15345  ,
15346  /* This indicates that a parity error has occurred */
15348  /*DOM-IGNORE-BEGIN*/
15349  = USART_ERROR_PARITY /*DOM-IGNORE-END*/
15350  ,
15351  /* This indicates that a framing error has occurred */
15353  /*DOM-IGNORE-BEGIN*/
15354  = USART_ERROR_FRAMING /*DOM-IGNORE-END*/
15355  ,
15356  /* This indicates a receiver overflow has occurred */
15358  /*DOM-IGNORE-BEGIN*/
15359  = USART_ERROR_RECEIVER_OVERRUN /*DOM-IGNORE-END*/
15360  ,
15361  /* Channel address error (Applicable in DMA mode) */
15362  DRV_USART_ERROR_ADDRESS /*DOM-IGNORE-BEGIN*/
15363  = ( 1 << 4 ) /* DOM-IGNORE-END*/
15364  } DRV_USART_ERROR ;
15365 // *****************************************************************************
15366 /* USART Client-Specific Driver Status
15367  Summary:
15368  Defines the client-specific status of the USART driver.
15369  Description:
15370  This enumeration defines the client-specific status codes of the USART
15371  driver.
15372  Remarks:
15373  Returned by the DRV_USART_ClientStatus function.
15374 */
15375 
15376 typedef
15377  enum
15378  {
15379  /* An error has occurred.*/
15381  /* The driver is closed, no operations for this client are ongoing,
15382  and/or the given handle is invalid. */
15384  /* The driver is currently busy and cannot start additional operations. */
15386  /* The module is running and ready for additional operations */
15389 // *****************************************************************************
15390 /* USART Driver Transfer Flags
15391  Summary
15392  Specifies the status of the receive or transmit
15393  Description
15394  This type specifies the status of the receive or transmit operation.
15395  Remarks:
15396  More than one of these values may be OR'd together to create a complete
15397  status value. To test a value of this type, the bit of interest must be
15398  ANDed with the value and checked to see if the result is non-zero.
15399 */
15400 
15401 typedef
15402  enum
15403  {
15404  /* Indicates that at least one byte of Data has been received */
15406  /*DOM-IGNORE-BEGIN*/
15407  = ( 1 << 0 ) /*DOM-IGNORE-END*/
15408  ,
15409  /* Indicates that the core driver receiver buffer is empty */
15411  /*DOM-IGNORE-BEGIN*/
15412  = ( 1 << 1 ) /*DOM-IGNORE-END*/
15413  ,
15414  /* Indicates that the core driver transmitter buffer is full */
15416  /*DOM-IGNORE-BEGIN*/
15417  = ( 1 << 2 ) /*DOM-IGNORE-END*/
15418  ,
15419  /* Indicates that the core driver transmitter buffer is empty */
15421  /*DOM-IGNORE-BEGIN*/
15422  = ( 1 << 3 ) /*DOM-IGNORE-END*/
15424 // *****************************************************************************
15425 /* USART Driver Initialization Data
15426  Summary:
15427  Defines the data required to initialize or reinitialize the USART driver
15428  Description:
15429  This data type defines the data required to initialize or reinitialize the
15430  USART driver. If the driver is built statically, the members of this data
15431  structure are statically over-ridden by static override definitions in the
15432  system_config.h file.
15433  Remarks:
15434  None.
15435 */
15436 
15437 typedef
15438  struct
15439  {
15440  /* System module initialization data */
15441  SYS_MODULE_INIT moduleInit ;
15442  /* Identifies USART hardware module (PLIB-level) ID. For a static build of
15443  the driver, this is overridden by DRV_USART_MODULE_ID macro in the
15444  system_config.h header file. */
15445  USART_MODULE_ID usartID ;
15446  /* Identifies the Operation mode of the USART driver. For a static build of
15447  the driver, this is overridden by DRV_USART_MODE_SELECT macro in the
15448  system_config.h header file. */
15450  /* Data required by the operation mode of the driver. For a static build of
15451  the driver, this is overridden by DRV_USART_MODE_DATA macro in the
15452  system_config.h header file. */
15454  /* Flags to enable specific features. Refer to the
15455  description of DRV_USART_INIT_FLAGS for more details. For a static build
15456  of the driver, this is overridden by DRV_USART_FLAGS macro in the
15457  system_config.h header file. */
15458  DRV_USART_INIT_FLAGS flags ;
15459  /* USART module Baud Rate Generator Clock. This typically
15460  the peripheral bus clock frequency. For a static build of the driver,
15461  this is overridden by DRV_USART_BRG_CLOCK macro in the system_config.h
15462  header file. */
15463  uint32_t brgClock ;
15464  /* The initial USART line control settings. For a static build of the driver
15465  this is overridden by the DRV_USART_LINE_CONTROL_SET macro in the
15466  system_config.h header file. */
15467  DRV_USART_LINE_CONTROL lineControl ;
15468  /* Baud Rate value to be used, if not using auto baud. For a static build of
15469  the driver, this is overridden by the DRV_USART_BAUD macro in the
15470  system_config.h header file. */
15471  uint32_t baud ;
15472  /* Handshaking mode. For a static build of the driver, this is overridden by
15473  the DRV_USART_HANDSHAKE_SET macro in the system_config.h header file. */
15474  DRV_USART_HANDSHAKE handshake ;
15475  /* Lines enabled for the USART operation. For a static build of the driver,
15476  this is overridden by the DRV_USART_LINES_ENABLE macro in
15477  the system_config.h header file.
15478  For PPS parts, pin selection in ports overrides this. */
15479  USART_OPERATION_MODE linesEnable ;
15480  /* Interrupt source ID for the transmitter interrupt. For a static build of
15481  the driver, this is overridden by the DRV_USART_TRANSMIT_INTERRUPT_SOURCE
15482  macro in the system_config.h header. */
15483  INT_SOURCE interruptTransmit ;
15484  /* Interrupt source ID for the receiver interrupt. For a static build of
15485  the driver, this is overridden by the DRV_USART_RECEIVE_INTERRUPT_SOURCE
15486  macro in the system_config.h header. */
15487  INT_SOURCE interruptReceive ;
15488  /* Interrupt source ID for the error Interrupt. For a static build of the
15489  driver, this is overridden by the DRV_USART_ERROR_INTERRUPT_SOURCE macro
15490  in the system_config.h header. */
15491  INT_SOURCE interruptError ;
15492  /* This is the receive buffer queue size. This is the maximum
15493  number of read requests that driver will queue. For a
15494  static build of the driver, this is overridden by the
15495  DRV_USART_RECEIVE_QUEUE_SIZE macro in system_config.h */
15496  unsigned int queueSizeReceive ;
15497  /* This is the transmit buffer queue size. This is the maximum
15498  number of write requests that driver will queue. For a
15499  static build of the driver, this is overridden by the
15500  DRV_USART_TRANSMIT_QUEUE_SIZE macro in system_config.h */
15501  unsigned int queueSizeTransmit ;
15502  /* This is the USART transmit DMA channel.
15503  For a static build of the driver, this is overridden by the
15504  DRV_USART_XMIT_DMA_CH_IDXn macro in system_config.h */
15505  DMA_CHANNEL dmaChannelTransmit ;
15506  /* This is the USART receive DMA channel.
15507  For a static build of the driver, this is overridden by the
15508  DRV_USART_RCV_DMA_CH_IDXn macro in system_config.h */
15509  DMA_CHANNEL dmaChannelReceive ;
15510  /* This is the USART transmit DMA channel interrupt.
15511  For a static build of the driver, this is overridden by the
15512  DRV_USART_XMIT_DMA_INT_SRC_IDXn macro in system_config.h */
15513  INT_SOURCE dmaInterruptTransmit ;
15514  /* This is the USART receive DMA channel interrupt.
15515  For a static build of the driver, this is overridden by the
15516  DRV_USART_RCV_DMA_INT_SRC_IDXn macro in system_config.h */
15517  INT_SOURCE dmaInterruptReceive ;
15518  } DRV_USART_INIT ;
15519 //DOM-IGNORE-BEGIN
15520 //DOM-IGNORE-END
15521  // #ifndef _DRV_USART_DEFINITIONS_H
15522 /*******************************************************************************
15523  End of File
15524 */
15525 
15526 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart_definitions.h*/
15527 /* CLOSE_FILE Include File */
15528 
15529 // DOM-IGNORE-BEGIN
15530 // DOM-IGNORE-END
15531 // *****************************************************************************
15532 // *****************************************************************************
15533 // Section: USART Driver Module Interface Routines
15534 // *****************************************************************************
15535 // *****************************************************************************
15536 // *****************************************************************************
15537 /* Function:
15538  SYS_MODULE_OBJ DRV_USART_Initialize
15539  (
15540  const SYS_MODULE_INDEX index,
15541  const SYS_MODULE_INIT * const init
15542  )
15543  Summary:
15544  Initializes the USART instance for the specified driver index.
15545  <p><b>Implementation:</b> Static/Dynamic</p>
15546  Description:
15547  This routine initializes the USART driver instance for the specified driver
15548  index, making it ready for clients to open and use it. The initialization
15549  data is specified by the init parameter. The initialization may fail if the
15550  number of driver objects allocated are insufficient or if the specified
15551  driver instance is already initialized. The driver instance index is
15552  independent of the USART module ID. For example, driver instance 0 can be
15553  assigned to USART2. If the driver is built statically, then some of the
15554  initialization parameters are overridden by configuration macros. Refer to
15555  the description of the DRV_USART_INIT data structure for more details on
15556  which members on this data structure are overridden.
15557  Precondition:
15558  None.
15559  Parameters:
15560  index - Identifier for the instance to be initialized
15561  init - Pointer to a data structure containing any data necessary to
15562  initialize the driver.
15563  Returns:
15564  If successful, returns a valid handle to a driver instance object.
15565  Otherwise, returns SYS_MODULE_OBJ_INVALID.
15566  Example:
15567  <code>
15568  // The following code snippet shows an example USART driver initialization.
15569  // The driver is initialized for normal mode and a baud of 300. The
15570  // receive queue size is set to 2 and transmit queue size is set to 3.
15571  DRV_USART_INIT usartInit;
15572  SYS_MODULE_OBJ objectHandle;
15573  usartInit.baud = 300;
15574  usartInit.mode = DRV_USART_OPERATION_MODE_NORMAL;
15575  usartInit.flags = DRV_USART_INIT_FLAG_NONE;
15576  usartInit.usartID = USART_ID_2;
15577  usartInit.brgClock = 80000000;
15578  usartInit.handshake = DRV_USART_HANDSHAKE_NONE;
15579  usartInit.lineControl = DRV_USART_LINE_CONTROL_8NONE1;
15580  usartInit.interruptError = INT_SOURCE_USART_2_ERROR;
15581  usartInit.interruptReceive = INT_SOURCE_USART_2_RECEIVE;
15582  usartInit.queueSizeReceive = 2;
15583  usartInit.queueSizeTransmit = 3;
15584  usartInit.interruptTransmit = INT_SOURCE_USART_2_TRANSMIT;
15585  usartInit.moduleInit.value = SYS_MODULE_POWER_RUN_FULL;
15586  objectHandle = DRV_USART_Initialize(DRV_USART_INDEX_1, (SYS_MODULE_INIT*)&usartInitData);
15587  if (SYS_MODULE_OBJ_INVALID == objectHandle)
15588  {
15589  // Handle error
15590  }
15591  </code>
15592  Remarks:
15593  This routine must be called before any other USART routine is called.
15594  This routine should only be called once during system initialization
15595  unless DRV_USART_Deinitialize is called to deinitialize the driver
15596  instance. This routine will NEVER block for hardware access.
15597 */
15598 
15599 SYS_MODULE_OBJ
15601  const SYS_MODULE_INDEX index ,
15602  const SYS_MODULE_INIT * const init ) ;
15603 // *****************************************************************************
15604 /* Function:
15605  void DRV_USART_Deinitialize( SYS_MODULE_OBJ object )
15606  Summary:
15607  Deinitializes the specified instance of the USART driver module.
15608  <p><b>Implementation:</b> Static/Dynamic</p>
15609  Description:
15610  Deinitializes the specified instance of the USART driver module, disabling
15611  its operation (and any hardware). Invalidates all the internal data.
15612  Precondition:
15613  Function DRV_USART_Initialize should have been called before calling this
15614  function.
15615  Parameters:
15616  object - Driver object handle, returned from the
15617  DRV_USART_Initialize routine
15618  Returns:
15619  None.
15620  Example:
15621  <code>
15622  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15623  SYS_STATUS status;
15624  DRV_USART_Deinitialize(object);
15625  status = DRV_USART_Status(object);
15626  if (SYS_MODULE_DEINITIALIZED != status)
15627  {
15628  // Check again later if you need to know
15629  // when the driver is deinitialized.
15630  }
15631  </code>
15632  Remarks:
15633  Once the Initialize operation has been called, the Deinitialize operation
15634  must be called before the Initialize operation can be called again. This
15635  routine will NEVER block waiting for hardware.
15636 */
15637 
15638 void
15640  SYS_MODULE_OBJ object ) ;
15641 // *****************************************************************************
15642 /* Function:
15643  SYS_STATUS DRV_USART_Status( SYS_MODULE_OBJ object )
15644  Summary:
15645  Gets the current status of the USART driver module.
15646  <p><b>Implementation:</b> Static/Dynamic</p>
15647  Description:
15648  This routine provides the current status of the USART driver module.
15649  Precondition:
15650  Function DRV_USART_Initialize should have been called before calling this
15651  function.
15652  Parameters:
15653  object - Driver object handle, returned from the
15654  DRV_USART_Initialize routine
15655  Returns:
15656  SYS_STATUS_READY - Indicates that the driver is busy with a
15657  previous system level operation and cannot start
15658  another
15659  SYS_STATUS_DEINITIALIZED - Indicates that the driver has been
15660  deinitialized
15661  Example:
15662  <code>
15663  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15664  SYS_STATUS usartStatus;
15665  usartStatus = DRV_USART _Status(object);
15666  if (SYS_STATUS_READY == usartStatus)
15667  {
15668  // This means the driver can be opened using the
15669  // DRV_USART_Open() function.
15670  }
15671  </code>
15672  Remarks:
15673  A driver can opened only when its status is SYS_STATUS_READY.
15674 */
15675 
15676 SYS_STATUS
15678  SYS_MODULE_OBJ object ) ;
15679 // *****************************************************************************
15680 /* Function:
15681  void DRV_USART_TasksTransmit (SYS_MODULE_OBJ object );
15682  Summary:
15683  Maintains the driver's transmit state machine and implements its ISR.
15684  <p><b>Implementation:</b> Static/Dynamic</p>
15685  Description:
15686  This routine is used to maintain the driver's internal transmit state
15687  machine and implement its transmit ISR for interrupt-driven implementations.
15688  In polling mode, this function should be called from the SYS_Tasks
15689  function. In interrupt mode, this function should be called in the transmit
15690  interrupt service routine of the USART that is associated with this USART
15691  driver hardware instance.
15692  Precondition:
15693  The DRV_USART_Initialize routine must have been called for the specified
15694  USART driver instance.
15695  Parameters:
15696  object - Object handle for the specified driver instance (returned from
15697  DRV_USART_Initialize)
15698  Returns:
15699  None.
15700  Example:
15701  <code>
15702  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15703  while (true)
15704  {
15705  DRV_USART_TasksTransmit (object);
15706  // Do other tasks
15707  }
15708  </code>
15709  Remarks:
15710  This routine is normally not called directly by an application. It is
15711  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15712  ISR.
15713  This routine may execute in an ISR context and will never block or access any
15714  resources that may cause it to block.
15715 */
15716 
15717 void
15719  SYS_MODULE_OBJ object ) ;
15720 // *****************************************************************************
15721 /* Function:
15722  void DRV_USART_TasksReceive (SYS_MODULE_OBJ object );
15723  Summary:
15724  Maintains the driver's receive state machine and implements its ISR.
15725  <p><b>Implementation:</b> Static/Dynamic</p>
15726  Description:
15727  This routine is used to maintain the driver's internal receive state machine
15728  and implement its receive ISR for interrupt-driven implementations. In
15729  polling mode, this function should be called from the SYS_Tasks function.
15730  In interrupt mode, this function should be called in the receive interrupt
15731  service routine of the USART that is associated with this USART driver
15732  hardware instance.
15733  Precondition:
15734  The DRV_USART_Initialize routine must have been called for the specified
15735  USART driver instance.
15736  Parameters:
15737  object - Object handle for the specified driver instance (returned from
15738  DRV_USART_Initialize)
15739  Returns:
15740  None.
15741  Example:
15742  <code>
15743  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15744  while (true)
15745  {
15746  DRV_USART_TasksReceive (object);
15747  // Do other tasks
15748  }
15749  </code>
15750  Remarks:
15751  This routine is normally not called directly by an application. It is
15752  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15753  ISR.
15754  This routine may execute in an ISR context and will never block or access any
15755  resources that may cause it to block.
15756 */
15757 
15758 void
15760  SYS_MODULE_OBJ object ) ;
15761 // *****************************************************************************
15762 /* Function:
15763  void DRV_USART_TasksError (SYS_MODULE_OBJ object );
15764  Summary:
15765  Maintains the driver's error state machine and implements its ISR.
15766  <p><b>Implementation:</b> Static/Dynamic</p>
15767  Description:
15768  This routine is used to maintain the driver's internal error state machine
15769  and implement its error ISR for interrupt-driven implementations. In
15770  polling mode, this function should be called from the SYS_Tasks function.
15771  In interrupt mode, this function should be called in the error interrupt
15772  service routine of the USART that is associated with this USART driver
15773  hardware instance.
15774  Precondition:
15775  The DRV_USART_Initialize routine must have been called for the specified
15776  USART driver instance.
15777  Parameters:
15778  object - Object handle for the specified driver instance (returned from
15779  DRV_USART_Initialize)
15780  Returns:
15781  None.
15782  Example:
15783  <code>
15784  SYS_MODULE_OBJ object; // Returned from DRV_USART_Initialize
15785  while (true)
15786  {
15787  DRV_USART_TasksError (object);
15788  // Do other tasks
15789  }
15790  </code>
15791  Remarks:
15792  This routine is normally not called directly by an application. It is
15793  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
15794  ISR.
15795  This routine may execute in an ISR context and will never block or access any
15796  resources that may cause it to block.
15797 */
15798 
15799 void
15801  SYS_MODULE_OBJ object ) ;
15802 // *****************************************************************************
15803 // *****************************************************************************
15804 // Section: USART Driver Client Routines
15805 // *****************************************************************************
15806 // *****************************************************************************
15807 // *****************************************************************************
15808 /* Function:
15809  DRV_HANDLE DRV_USART_Open
15810  (
15811  const SYS_MODULE_INDEX index,
15812  const DRV_IO_INTENT ioIntent
15813  )
15814  Summary:
15815  Opens the specified USART driver instance and returns a handle to it.
15816  <p><b>Implementation:</b> Static/Dynamic</p>
15817  Description:
15818  This routine opens the specified USART driver instance and provides a
15819  handle that must be provided to all other client-level operations to
15820  identify the caller and the instance of the driver. The ioIntent
15821  parameter defines how the client interacts with this driver instance.
15822  The DRV_IO_INTENT_BLOCKING and DRV_IO_INTENT_NONBLOCKING ioIntent options
15823  additionally affect the behavior of the DRV_USART_Read and
15824  DRV_USART_Write functions. If the ioIntent is DRV_IO_INTENT_NONBLOCKING,
15825  then these function will not block even if the required amount of data could
15826  not be processed. If the ioIntent is DRV_IO_INTENT_BLOCKING, these functions
15827  will block until the required amount of data is processed. If the driver is
15828  configured for polling and bare-metal operation, it will not support
15829  DRV_IO_INTENT_BLOCKING. The driver will operation will always be
15830  non-blocking.
15831  If ioIntent is DRV_IO_INTENT_READ, the client will only be able to read from
15832  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be able
15833  to write to the driver. If the ioIntent is DRV_IO_INTENT_READWRITE, the
15834  client will be able to do both, read and write.
15835  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
15836  exclusive access to this client. The driver cannot be opened by any
15837  other client.
15838  Precondition:
15839  Function DRV_USART_Initialize must have been called before calling this
15840  function.
15841  Parameters:
15842  index - Identifier for the object instance to be opened
15843  intent - Zero or more of the values from the enumeration
15844  DRV_IO_INTENT "ORed" together to indicate the intended use
15845  of the driver. See function description for details.
15846  Returns:
15847  If successful, the routine returns a valid open-instance handle (a number
15848  identifying both the caller and the module instance).
15849  If an error occurs, the return value is DRV_HANDLE_INVALID. Error can occur
15850  - if the number of client objects allocated via DRV_USART_CLIENTS_NUMBER is
15851  insufficient.
15852  - if the client is trying to open the driver but driver has been opened
15853  exclusively by another client.
15854  - if the driver hardware instance being opened is not initialized or is
15855  invalid.
15856  - if the client is trying to open the driver exclusively, but has already
15857  been opened in a non exclusive mode by another client.
15858  - if the driver is not ready to be opened, typically when the initialize
15859  routine has not completed execution.
15860  Example:
15861  <code>
15862  DRV_HANDLE handle;
15863  handle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
15864  if (DRV_HANDLE_INVALID == handle)
15865  {
15866  // Unable to open the driver
15867  // May be the driver is not initialized or the initialization
15868  // is not complete.
15869  }
15870  </code>
15871  Remarks:
15872  The handle returned is valid until the DRV_USART_Close routine is called.
15873  This routine will NEVER block waiting for hardware.If the requested intent
15874  flags are not supported, the routine will return DRV_HANDLE_INVALID. This
15875  function is thread safe in a RTOS application.
15876 */
15877 
15878 DRV_HANDLE
15879  DRV_USART_Open (
15880  const SYS_MODULE_INDEX index ,
15881  const DRV_IO_INTENT ioIntent ) ;
15882 // *****************************************************************************
15883 /* Function:
15884  void DRV_USART_Close( DRV_Handle handle )
15885  Summary:
15886  Closes an opened-instance of the USART driver.
15887  <p><b>Implementation:</b> Static/Dynamic</p>
15888  Description:
15889  This routine closes an opened-instance of the USART driver, invalidating the
15890  handle. Any buffers in the driver queue that were submitted by this client
15891  will be removed. After calling this routine, the handle passed in "handle"
15892  must not be used with any of the remaining driver routines (with one
15893  possible exception described in the "Remarks" section). A new handle must
15894  be obtained by calling DRV_USART_Open before the caller may use the driver
15895  again
15896  Precondition:
15897  The DRV_USART_Initialize routine must have been called for the specified
15898  USART driver instance.
15899  DRV_USART_Open must have been called to obtain a valid opened device handle.
15900  Parameters:
15901  handle - A valid open-instance handle, returned from the driver's
15902  open routine
15903  Returns:
15904  None.
15905  Example:
15906  <code>
15907  DRV_HANDLE handle; // Returned from DRV_USART_Open
15908  DRV_USART_Close(handle);
15909  // After this point, the handle cannot be used with any other function
15910  // except the DRV_USART_ClientStatus function, which can be used to query
15911  // the success status of the DRV_USART_Close function.
15912  while(DRV_USART_CLIENT_STATUS_CLOSED != DRV_USART_ClientStatus(handle));
15913  </code>
15914  Remarks:
15915  Usually there is no need for the client to verify that the Close operation
15916  has completed. The driver will abort any ongoing operations when this
15917  routine is called. However, if it requires additional time to do so in a
15918  non-blocking environment, it will still return from the Close operation but
15919  the handle is now a zombie handle. The client can only call the
15920  DRV_USART_ClientStatus on a zombie handle to track the completion of the
15921  Close operation. The DRV_USART_ClientStatus routine will return
15922  DRV_CLIENT_STATUS_CLOSED when the close operation has completed.
15923 */
15924 
15925 void
15926  DRV_USART_Close (
15927  const DRV_HANDLE handle ) ;
15928 // *****************************************************************************
15929 /*
15930  Function:
15931  DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus( DRV_HANDLE handle )
15932  Summary:
15933  Gets the current client-specific status the USART driver.
15934  <p><b>Implementation:</b> Static/Dynamic</p>
15935  Description:
15936  This function gets the client-specific status of the USART driver associated
15937  with the given handle. This function can be used to check the status of
15938  client after the DRV_USART_Close() function has been called.
15939  Preconditions:
15940  The DRV_USART_Initialize function must have been called.
15941  DRV_USART_Open must have been called to obtain a valid opened device
15942  handle.
15943  Parameters:
15944  handle - Handle returned from the driver's open function.
15945  Returns:
15946  A DRV_USART_CLIENT_STATUS value describing the current status of the
15947  driver.
15948  Example:
15949  <code>
15950  DRV_HANDLE handle; // Returned from DRV_USART_Open
15951  DRV_USART_CLIENT_STATUS status;
15952  status = DRV_USART_ClientStatus(handle);
15953  if( DRV_USART_CLIENT_STATUS_CLOSED != status )
15954  {
15955  // The client had not closed.
15956  }
15957  </code>
15958  Remarks:
15959  This function will not block for hardware access and will immediately return
15960  the current status. This function is thread safe when called in a RTOS
15961  application.
15962 */
15963 
15966  DRV_HANDLE handle ) ;
15967 // *****************************************************************************
15968 // *****************************************************************************
15969 // Section: USART Driver Buffer Queuing Model Interface Routines
15970 // *****************************************************************************
15971 // *****************************************************************************
15972 // *****************************************************************************
15973 /* Function:
15974  void DRV_USART_BufferAddWrite
15975  (
15976  const DRV_HANDLE handle,
15977  DRV_USART_BUFFER_HANDLE * bufferHandle,
15978  void * buffer,
15979  size_t size
15980  );
15981  Summary:
15982  Schedule a non-blocking driver write operation.
15983  <p><b>Implementation:</b> Static/Dynamic</p>
15984  Description:
15985  This function schedules a non-blocking write operation. The function returns
15986  with a valid buffer handle in the bufferHandle argument if the write request
15987  was scheduled successfully. The function adds the request to the hardware
15988  instance transmit queue and returns immediately. While the request is in the
15989  queue, the application buffer is owned by the driver and should not be
15990  modified. On returning, the bufferHandle parameter may be
15991  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
15992  - if a buffer could not be allocated to the request
15993  - if the input buffer pointer is NULL
15994  - if the client opened the driver for read-only
15995  - if the buffer size is 0
15996  - if the transmit queue is full or the queue depth is insufficient
15997  If the requesting client registered an event callback with the driver, the
15998  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
15999  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16000  was not processed successfully.
16001  Precondition:
16002  The DRV_USART_Initialize routine must have been called for the specified
16003  USART device instance and the DRV_USART_Status must have returned
16004  SYS_STATUS_READY.
16005  DRV_USART_Open must have been called to obtain a valid opened device handle.
16006  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16007  the DRV_USART_Open call.
16008  Parameters:
16009  handle - Handle of the communication channel as return by the
16010  DRV_USART_Open function.
16011  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16012  buffer - Data to be transmitted.
16013  size - Buffer size in bytes.
16014  Returns:
16015  The bufferHandle parameter will contain the return buffer handle. This will be
16016  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16017  Example:
16018  <code>
16019  MY_APP_OBJ myAppObj;
16020  uint8_t mybuffer[MY_BUFFER_SIZE];
16021  DRV_USART_BUFFER_HANDLE bufferHandle;
16022  // myUSARTHandle is the handle returned
16023  // by the DRV_USART_Open function.
16024  // Client registers an event handler with driver
16025  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16026  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16027  DRV_USART_BufferAddWrite(myUSARThandle, &bufferHandle,
16028  myBuffer, MY_BUFFER_SIZE);
16029  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16030  {
16031  // Error handling here
16032  }
16033  // Event is received when
16034  // the buffer is processed.
16035  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16036  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16037  {
16038  // contextHandle points to myAppObj.
16039  switch(event)
16040  {
16041  case DRV_USART_BUFFER_EVENT_COMPLETE:
16042  // This means the data was transferred.
16043  break;
16044  case DRV_USART_BUFFER_EVENT_ERROR:
16045  // Error handling here.
16046  break;
16047  default:
16048  break;
16049  }
16050  }
16051  </code>
16052  Remarks:
16053  This function is thread safe in a RTOS application. It can be called from
16054  within the USART Driver Buffer Event Handler that is registered by this
16055  client. It should not be called in the event handler associated with another
16056  USART driver instance. It should not otherwise be called directly in an ISR.
16057 */
16058 
16059 void
16061  const DRV_HANDLE handle ,
16062  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16063  void * buffer ,
16064  const size_t size ) ;
16065 // *****************************************************************************
16066 /* Function:
16067  void DRV_USART_AddressedBufferAddWrite
16068  (
16069  const DRV_HANDLE hClient,
16070  DRV_USART_BUFFER_HANDLE * bufferHandle,
16071  uint8_t address,
16072  void * source,
16073  size_t nWords
16074  );
16075  Summary:
16076  Schedule a non-blocking addressed driver write operation.
16077  <p><b>Implementation:</b> Dynamic</p>
16078  Description:
16079  This function schedules a non-blocking addressed write operation. The function returns
16080  with a valid buffer handle in the bufferHandle argument if the addressed write request
16081  was scheduled successfully. The function adds the request to the hardware
16082  instance transmit queue and returns immediately. While the request is in the
16083  queue, the application buffer is owned by the driver and should not be
16084  modified. On returning, the bufferHandle parameter may be
16085  DRV_USART_BUFFER_HANDLE_INVALID for the following reasons:
16086  - if a buffer could not be allocated to the request
16087  - if the input buffer pointer is NULL
16088  - if the client opened the driver for read-only
16089  - if the buffer size is 0
16090  - if the transmit queue is full or the queue depth is insufficient
16091  If the requesting client registered an event callback with the driver, the
16092  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16093  processed successfully or a DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16094  was not processed successfully.
16095  Precondition:
16096  The DRV_USART_Initialize routine must have been called for the specified
16097  USART device instance and the DRV_USART_Status must have returned
16098  SYS_STATUS_READY.
16099  DRV_USART_Open must have been called to obtain a valid opened device handle.
16100  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16101  the DRV_USART_Open call.
16102  The operation mode of the driver must be DRV_USART_OPERATION_MODE_ADDRESSED.
16103  Parameters:
16104  hClient - Handle of the communication channel as return by the
16105  DRV_USART_Open function.
16106  bufferHandle - Pointer to an argument that will contain the return buffer handle.
16107  address - Address of the receiver client
16108  source - Data to be transmitted.
16109  size - Buffer size in 16-bit words.
16110  Returns:
16111  The bufferHandle parameter will contain the return buffer handle. This will be
16112  DRV_USART_BUFFER_HANDLE_INVALID if the function was not successful.
16113  Example:
16114  <code>
16115  MY_APP_OBJ myAppObj;
16116  uint16_t mybuffer[MY_BUFFER_SIZE];
16117  DRV_USART_BUFFER_HANDLE bufferHandle;
16118  uint8_t clientAddress;
16119  // myUSARTHandle is the handle returned
16120  // by the DRV_USART_Open function.
16121  // Client registers an event handler with driver
16122  clientAddress = 0x60;
16123  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16124  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16125  DRV_USART_AddressedBufferAddWrite(myUSARThandle, &bufferHandle, clientAddress
16126  myBuffer, MY_BUFFER_SIZE);
16127  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16128  {
16129  // Error handling here
16130  }
16131  // Event is received when
16132  // the buffer is processed.
16133  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16134  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16135  {
16136  // contextHandle points to myAppObj.
16137  switch(event)
16138  {
16139  case DRV_USART_BUFFER_EVENT_COMPLETE:
16140  // This means the data was transferred.
16141  break;
16142  case DRV_USART_BUFFER_EVENT_ERROR:
16143  // Error handling here.
16144  break;
16145  default:
16146  break;
16147  }
16148  }
16149  </code>
16150  Remarks:
16151  This function is thread safe in a RTOS application. It can be called from
16152  within the USART Driver Buffer Event Handler that is registered by this
16153  client. It should not be called in the event handler associated with another
16154  USART driver instance. It should not otherwise be called directly in an ISR.
16155  The source buffer should be a 16-bit word aligned buffer.
16156  The 9th bit of the higher byte 16-bit buffer is used to indicate data/address.
16157 */
16158 
16159 void
16161  const DRV_HANDLE hClient ,
16162  DRV_USART_BUFFER_HANDLE * bufferHandle ,
16163  uint8_t address ,
16164  void * source ,
16165  size_t nWords ) ;
16166 // *****************************************************************************
16167 /* Function:
16168  void DRV_USART_BufferAddRead
16169  (
16170  const DRV_HANDLE handle,
16171  DRV_USART_BUFFER_HANDLE * bufferHandle,
16172  void * buffer,
16173  const size_t size
16174  )
16175  Summary:
16176  Schedule a non-blocking driver read operation.
16177  <p><b>Implementation:</b> Static/Dynamic</p>
16178  Description:
16179  This function schedules a non-blocking read operation. The function returns
16180  with a valid buffer handle in the bufferHandle argument if the read request
16181  was scheduled successfully. The function adds the request to the hardware
16182  instance receive queue and returns immediately. While the request is in the
16183  queue, the application buffer is owned by the driver and should not be
16184  modified. The function returns DRV_USART_BUFFER_HANDLE_INVALID in the
16185  bufferHandle argument:
16186  - if a buffer could not be allocated to the request
16187  - if the input buffer pointer is NULL
16188  - if the buffer size is 0
16189  - if the read queue size is full or queue depth is insufficient.
16190  - if the driver handle is invalid
16191  If the requesting client registered an event callback with the driver, the
16192  driver will issue a DRV_USART_BUFFER_EVENT_COMPLETE event if the buffer was
16193  processed successfully of DRV_USART_BUFFER_EVENT_ERROR event if the buffer
16194  was not processed successfully.
16195  Precondition:
16196  The DRV_USART_Initialize routine must have been called for the specified
16197  USART device instance and the DRV_USART_Status must have returned
16198  SYS_STATUS_READY.
16199  DRV_USART_Open must have been called to obtain a valid opened device handle.
16200  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16201  the DRV_USART_Open call.
16202  Parameters:
16203  handle - Handle of the communication channel as returned by the
16204  DRV_USART_Open function.
16205  buffer - Buffer where the received data will be stored.
16206  size - Buffer size in bytes.
16207  Returns:
16208  The buffer handle is returned in the bufferHandle argument. This is
16209  DRV_USART_BUFFER_HANDLE_INVALID if the request was not successful.
16210  Example:
16211  <code>
16212  MY_APP_OBJ myAppObj;
16213  uint8_t mybuffer[MY_BUFFER_SIZE];
16214  DRV_USART_BUFFER_HANDLE bufferHandle;
16215  // myUSARTHandle is the handle returned
16216  // by the DRV_USART_Open function.
16217  // Client registers an event handler with driver
16218  DRV_USART_BufferEventHandlerSet(myUSARTHandle,
16219  APP_USARTBufferEventHandler, (uintptr_t)&myAppObj);
16220  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle,
16221  myBuffer, MY_BUFFER_SIZE);
16222  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16223  {
16224  // Error handling here
16225  }
16226  // Event is received when
16227  // the buffer is processed.
16228  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16229  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle)
16230  {
16231  // contextHandle points to myAppObj.
16232  switch(event)
16233  {
16234  case DRV_USART_BUFFER_EVENT_COMPLETE:
16235  // This means the data was transferred.
16236  break;
16237  case DRV_USART_BUFFER_EVENT_ERROR:
16238  // Error handling here.
16239  break;
16240  default:
16241  break;
16242  }
16243  }
16244  </code>
16245  Remarks:
16246  This function is thread safe in a RTOS application. It can be called from
16247  within the USART Driver Buffer Event Handler that is registered by the
16248  client. It should not be called in the event handler associated with another
16249  USART driver instance. It should not be called directly in an ISR.
16250 */
16251 
16252 void
16254  const DRV_HANDLE handle ,
16255  DRV_USART_BUFFER_HANDLE * const bufferHandle ,
16256  void * buffer ,
16257  const size_t size ) ;
16258 // *****************************************************************************
16259 /* Function:
16260  void DRV_USART_BufferEventHandlerSet
16261  (
16262  const DRV_HANDLE handle,
16263  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler,
16264  const uintptr_t context
16265  )
16266  Summary:
16267  Allows a client to identify a buffer event handling function for the driver
16268  to call back when queued buffer transfers have finished.
16269  <p><b>Implementation:</b> Static/Dynamic</p>
16270  Description:
16271  This function allows a client to identify a buffer event handling function
16272  for the driver to call back when queued buffer transfers have finished.
16273  When a client calls either the DRV_USART_BufferAddRead or
16274  DRV_USART_BufferAddWrite function, it is provided with a handle identifying
16275  the buffer that was added to the driver's buffer queue. The driver will
16276  pass this handle back to the client by calling "eventHandler" function when
16277  the buffer transfer has completed.
16278  The event handler should be set before the client performs any "buffer add"
16279  operations that could generate events. The event handler once set, persists
16280  until the client closes the driver or sets another event handler (which
16281  could be a "NULL" pointer to indicate no callback).
16282  Precondition:
16283  The DRV_USART_Initialize routine must have been called for the specified
16284  USART driver instance.
16285  DRV_USART_Open must have been called to obtain a valid opened device handle.
16286  Parameters:
16287  handle - A valid open-instance handle, returned from the driver's
16288  open routine
16289  eventHandler - Pointer to the event handler function.
16290  context - The value of parameter will be passed back to the client
16291  unchanged, when the eventHandler function is called. It can
16292  be used to identify any client specific data object that
16293  identifies the instance of the client module (for example,
16294  it may be a pointer to the client module's state structure).
16295  Returns:
16296  None.
16297  Example:
16298  <code>
16299  // myAppObj is an application specific state data object.
16300  MY_APP_OBJ myAppObj;
16301  uint8_t mybuffer[MY_BUFFER_SIZE];
16302  DRV_USART_BUFFER_HANDLE bufferHandle;
16303  // myUSARTHandle is the handle returned
16304  // by the DRV_USART_Open function.
16305  // Client registers an event handler with driver. This is done once
16306  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16307  (uintptr_t)&myAppObj );
16308  DRV_USART_BufferAddRead(myUSARThandle, &bufferHandle
16309  myBuffer, MY_BUFFER_SIZE);
16310  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16311  {
16312  // Error handling here
16313  }
16314  // Event Processing Technique. Event is received when
16315  // the buffer is processed.
16316  void APP_USARTBufferEventHandler(DRV_USART_BUFFER_EVENT event,
16317  DRV_USART_BUFFER_HANDLE handle, uintptr_t context)
16318  {
16319  // The context handle was set to an application specific
16320  // object. It is now retrievable easily in the event handler.
16321  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) context;
16322  switch(event)
16323  {
16324  case DRV_USART_BUFFER_EVENT_COMPLETE:
16325  // This means the data was transferred.
16326  break;
16327  case DRV_USART_BUFFER_EVENT_ERROR:
16328  // Error handling here.
16329  break;
16330  default:
16331  break;
16332  }
16333  }
16334  </code>
16335  Remarks:
16336  If the client does not want to be notified when the queued buffer transfer
16337  has completed, it does not need to register a callback. This function is
16338  thread safe when called in a RTOS application.
16339 */
16340 
16341 void
16343  const DRV_HANDLE handle ,
16344  const DRV_USART_BUFFER_EVENT_HANDLER eventHandler ,
16345  const uintptr_t context ) ;
16346 // *****************************************************************************
16347 /* Function:
16348  DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove( DRV_USART_BUFFER_HANDLE bufferHandle )
16349  Summary:
16350  Removes a requested buffer from the queue.
16351  <p><b>Implementation:</b> Static/Dynamic</p>
16352  Description:
16353  This function removes a specified buffer from the queue.
16354  The client can use this function to delete
16355  1. An unwated stalled buffer.
16356  2. Queued buffers on timeout.
16357  or in any other use case.
16358  Precondition:
16359  The DRV_USART_Initialize routine must have been called for the specified
16360  USART driver instance.
16361  DRV_USART_Open must have been called to obtain a valid opened device handle.
16362  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16363  must have been called and a valid buffer handle returned.
16364  Parameters:
16365  bufferhandle - Handle of the buffer to delete.
16366  Returns:
16367  DRV_USART_BUFFER_RESULT_HANDLE_INVALID - Buffer handle is invalid.
16368  DRV_USART_BUFFER_RESULT_HANDLE_EXPIRED - Buffer handle is expired.
16369  DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY - Buffer is removed from the
16370  queue successfully.
16371  DRV_USART_BUFFER_RESULT_REMOVAL_FAILED - Failed to remove buffer from
16372  the queue because of mutex timeout in RTOS environment.
16373  Example:
16374  <code>
16375  // myAppObj is an application specific object.
16376  MY_APP_OBJ myAppObj;
16377  uint8_t mybuffer[MY_BUFFER_SIZE];
16378  DRV_USART_BUFFER_HANDLE bufferHandle;
16379  // myUSARTHandle is the handle returned
16380  // by the DRV_USART_Open function.
16381  // Client registers an event handler with driver. This is done once
16382  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16383  (uintptr_t)&myAppObj );
16384  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16385  myBuffer, MY_BUFFER_SIZE );
16386  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16387  {
16388  // Error handling here
16389  }
16390  // Event Processing Technique. Event is received when
16391  // the buffer is processed.
16392  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16393  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16394  {
16395  switch(event)
16396  {
16397  case DRV_USART_BUFFER_EVENT_COMPLETE:
16398  // This means the data was transferred.
16399  break;
16400  case DRV_USART_BUFFER_EVENT_ERROR:
16401  // Error handling here.
16402  break;
16403  default:
16404  break;
16405  }
16406  }
16407  // Timeout function, where remove queued buffer if it still exists.
16408  void APP_TimeOut(void)
16409  {
16410  DRV_USART_BUFFER_RESULT bufferResult;
16411  bufferResult = DRV_USART_BufferRemove(bufferHandle);
16412  if(DRV_USART_BUFFER_RESULT_REMOVED_SUCCESFULLY == bufferResult)
16413  {
16414  //Buffer removed succesfully from the queue
16415  }
16416  else
16417  {
16418  //Either buffer is invalid or expired.
16419  //Or not able to acquire mutex in RTOS mode.
16420  }
16421  }
16422  </code>
16423  Remarks:
16424  This function is thread safe when used in a RTOS application.
16425 */
16426 
16429  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16430 // *****************************************************************************
16431 /* Function:
16432  size_t DRV_USART_BufferCompletedBytesGet
16433  (
16434  DRV_USART_BUFFER_HANDLE bufferHandle
16435  );
16436  Summary:
16437  Returns the number of bytes that have been processed for the
16438  specified buffer.
16439  <p><b>Implementation:</b> Static/Dynamic</p>
16440  Description:
16441  This function returns number of bytes that have been processed for the
16442  specified buffer. The client can use this function, in a case where the
16443  buffer has terminated due to an error, to obtain the number of bytes that
16444  have been processed. Or in any other use case.
16445  This function can be used for non-DMA buffer transfers only. It cannot be
16446  used when the USART driver is configured to use DMA.
16447  Precondition:
16448  The DRV_USART_Initialize routine must have been called for the specified
16449  USART driver instance.
16450  DRV_USART_Open must have been called to obtain a valid opened device handle.
16451  Either the DRV_USART_BufferAddRead or DRV_USART_BufferAddWrite function
16452  must have been called and a valid buffer handle returned.
16453  Parameters:
16454  bufferhandle - Handle for the buffer of which the processed number of bytes
16455  to be obtained.
16456  Returns:
16457  Returns the number of bytes that have been processed for this buffer.
16458  Returns DRV_USART_BUFFER_HANDLE_INVALID for an invalid or an expired
16459  buffer handle.
16460  Example:
16461  <code>
16462  // myAppObj is an application specific object.
16463  MY_APP_OBJ myAppObj;
16464  uint8_t mybuffer[MY_BUFFER_SIZE];
16465  DRV_USART_BUFFER_HANDLE bufferHandle;
16466  // myUSARTHandle is the handle returned
16467  // by the DRV_USART_Open function.
16468  // Client registers an event handler with driver. This is done once
16469  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
16470  (uintptr_t)&myAppObj );
16471  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
16472  myBuffer, MY_BUFFER_SIZE );
16473  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
16474  {
16475  // Error handling here
16476  }
16477  // Event Processing Technique. Event is received when
16478  // the buffer is processed.
16479  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
16480  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
16481  {
16482  // The context handle was set to an application specific
16483  // object. It is now retrievable easily in the event handler.
16484  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
16485  size_t processedBytes;
16486  switch(event)
16487  {
16488  case DRV_USART_BUFFER_EVENT_COMPLETE:
16489  // This means the data was transferred.
16490  break;
16491  case DRV_USART_BUFFER_EVENT_ERROR:
16492  // Error handling here.
16493  // We can find out how many bytes were processed in this
16494  // buffer before the error occurred.
16495  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
16496  break;
16497  default:
16498  break;
16499  }
16500  }
16501  </code>
16502  Remarks:
16503  This function is thread safe when used in a RTOS application.
16504 */
16505 
16506 size_t
16508  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16509 // *****************************************************************************
16510 /* Function:
16511  size_t DRV_USART_BufferProcessedSizeGet
16512  (
16513  DRV_USART_BUFFER_HANDLE bufferHandle
16514  );
16515  Summary:
16516  This API will be deprecated and not recommended to use.
16517  Use DRV_USART_BufferCompletedBytesGet to get the number of bytes
16518  processed for the specified buffer.
16519  Description:
16520  None.
16521  Precondition:
16522  None.
16523  Parameters:
16524  None.
16525  Returns:
16526  None.
16527  Example:
16528  None.
16529  Remarks:
16530  None.
16531 */
16532 
16533 size_t
16535  DRV_USART_BUFFER_HANDLE bufferHandle ) ;
16536 // *****************************************************************************
16537 // *****************************************************************************
16538 // Section: USART Driver File System Model Routines
16539 // *****************************************************************************
16540 // *****************************************************************************
16541 // *****************************************************************************
16542 /* Function:
16543  size_t DRV_USART_Read
16544  (
16545  const DRV_HANDLE handle,
16546  void * buffer,
16547  const size_t numbytes
16548  )
16549  Summary:
16550  Reads data from the USART.
16551  <p><b>Implementation:</b> Static/Dynamic</p>
16552  Description:
16553  This routine reads data from the USART. This function is blocking if the
16554  driver was opened by the client for blocking operation. This function will
16555  not block if the driver was opened by the client for non blocking operation.
16556  If the ioIntent parameter at the time of opening the driver was
16557  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16558  until) numbytes of bytes have been received or if an error occurred. If there
16559  are buffers queued for receiving data, these buffers will be serviced first. The
16560  function will not return until the requested number of bytes have been read.
16561  If the ioIntent parameter at the time of opening the driver was
16562  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16563  bytes that were actually read. The function will not wait until numBytes of
16564  bytes have been read. If there are buffer queued for reading data, then the
16565  function will not block and will return immediately with 0 bytes read.
16566  Precondition:
16567  The DRV_USART_Initialize routine must have been called for the specified
16568  USART driver instance.
16569  DRV_USART_Open must have been called to obtain a valid opened device handle.
16570  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified in
16571  the DRV_USART_Open call.
16572  Parameters:
16573  handle - A valid open-instance handle, returned from the driver's
16574  open routine
16575  buffer - Buffer into which the data read from the USART instance
16576  will be placed.
16577  numbytes - Total number of bytes that need to be read from the module
16578  instance (must be equal to or less than the size of the
16579  buffer)
16580  Returns:
16581  Number of bytes actually copied into the caller's buffer. Returns
16582  DRV_USART_READ_ERROR in case of an error.
16583  Example:
16584  <code>
16585  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16586  char myBuffer[MY_BUFFER_SIZE];
16587  unsigned int count;
16588  unsigned int total;
16589  total = 0;
16590  do
16591  {
16592  count = DRV_USART_Read(myUSARTHandle, &myBuffer[total], MY_BUFFER_SIZE - total);
16593  if(count == DRV_USART_READ_ERROR)
16594  {
16595  // There was an error. The DRV_USART_ErrorGet() function
16596  // can be called to find the exact error.
16597  }
16598  total += count;
16599  // Do something else...
16600  } while( total < MY_BUFFER_SIZE );
16601  </code>
16602  Remarks:
16603  This function is thread safe in a RTOS application. If the driver is
16604  configured for polled operation, this it will not support blocking operation
16605  in a bare metal (non-RTOS) application.
16606 */
16607 
16608 size_t
16609  DRV_USART_Read (
16610  const DRV_HANDLE handle ,
16611  void * buffer ,
16612  const size_t numbytes ) ;
16613 // *****************************************************************************
16614 /* Function:
16615  size_t DRV_USART_Write
16616  (
16617  const DRV_HANDLE handle,
16618  void * buffer,
16619  const size_t numbytes
16620  )
16621  Summary:
16622  Writes data to the USART.
16623  <p><b>Implementation:</b> Static/Dynamic</p>
16624  Description:
16625  This routine writes data to the USART. This function is blocking if the
16626  driver was opened by the client for blocking operation. This function will
16627  not block if the driver was opened by the client for non blocking operation.
16628  If the ioIntent parameter at the time of opening the driver was
16629  DRV_IO_INTENT_BLOCKING, this function will only return when (or will block
16630  until) numbytes of bytes have been transmitted or if an error occurred. If
16631  there are buffers queued for writing, the function will wait until all the
16632  preceding buffers are completed. Ongoing buffer transmit operations will not
16633  be affected.
16634  If the ioIntent parameter at the time of opening the driver was
16635  DRV_IO_INTENT_NON_BLOCKING, this function will return with the number of
16636  bytes that were actually accepted for transmission. The function will not
16637  wait until numBytes of bytes have been transmitted. If there a buffers queued
16638  for transmit, the function will not wait and will return immediately with 0
16639  bytes.
16640  Precondition:
16641  The DRV_USART_Initialize routine must have been called for the specified
16642  USART driver instance.
16643  DRV_USART_Open must have been called to obtain a valid opened device handle.
16644  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified in
16645  the DRV_USART_Open call.
16646  Parameters:
16647  handle - A valid open-instance handle, returned from the driver's
16648  open routine
16649  buffer - Buffer containing the data to written.
16650  numbytes - size of the buffer
16651  Returns:
16652  Number of bytes actually written to the driver. Return DRV_USART_WRITE_ERROR
16653  in case of an error.
16654  Example:
16655  <code>
16656  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16657  char myBuffer[MY_BUFFER_SIZE];
16658  int count;
16659  unsigned int total;
16660  total = 0;
16661  do
16662  {
16663  count = DRV_USART_Write(myUSARTHandle, &myBuffer[total],
16664  MY_BUFFER_SIZE - total);
16665  total += count;
16666  // Do something else...
16667  } while( total < MY_BUFFER_SIZE );
16668  </code>
16669  Remarks:
16670  This function is thread safe in a RTOS application. This function is thread
16671  safe in a RTOS application. If the driver is configured for polled
16672  operation, this it will not support blocking operation in a bare metal (non-RTOS)
16673  application.
16674 */
16675 
16676 size_t
16677  DRV_USART_Write (
16678  const DRV_HANDLE handle ,
16679  void * buffer ,
16680  const size_t numbytes ) ;
16681 // *****************************************************************************
16682 /* Function:
16683  DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus( const DRV_HANDLE handle )
16684  Summary:
16685  Returns the transmitter and receiver transfer status.
16686  <p><b>Implementation:</b> Static/Dynamic</p>
16687  Description:
16688  This returns the transmitter and receiver transfer status.
16689  Precondition:
16690  The DRV_USART_Initialize routine must have been called for the specified
16691  USART driver instance.
16692  DRV_USART_Open must have been called to obtain a valid opened device handle.
16693  Parameters:
16694  handle - A valid open-instance handle, returned from the driver's
16695  open routine
16696  Returns:
16697  A DRV_USART_TRANSFER_STATUS value describing the current status
16698  of the transfer.
16699  Example:
16700  <code>
16701  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16702  if (DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle))
16703  {
16704  // Data has been received that can be read
16705  }
16706  </code>
16707  Remarks:
16708  The returned status may contain a value with more than one of the bits
16709  specified in the DRV_USART_TRANSFER_STATUS enumeration set. The caller
16710  should perform an "AND" with the bit of interest and verify if the result is
16711  non-zero (as shown in the example) to verify the desired status bit. This
16712  function is thread safe when called in a RTOS application.
16713 */
16714 
16717  const DRV_HANDLE handle ) ;
16718 // *****************************************************************************
16719 // *****************************************************************************
16720 // Section: USART Driver Byte Model Routines
16721 // *****************************************************************************
16722 // *****************************************************************************
16723 // *****************************************************************************
16724 /* Function:
16725  uint8_t DRV_USART_ReadByte( const DRV_HANDLE handle )
16726  Summary:
16727  Reads a byte of data from the USART.
16728  <p><b>Implementation:</b> Static/Dynamic</p>
16729  Description:
16730  This routine reads a byte of data from the USART.
16731  Precondition:
16732  The DRV_USART_Initialize routine must have been called for the specified
16733  USART driver instance.
16734  DRV_USART_Open must have been called to obtain a valid opened device handle.
16735  The transfer status should be checked to see if the receiver is not empty
16736  before calling this function.
16737  Parameters:
16738  handle - A valid open-instance handle, returned from the driver's
16739  open routine
16740  Returns:
16741  A data byte received by the driver.
16742  Example:
16743  <code>
16744  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16745  char myBuffer[MY_BUFFER_SIZE];
16746  unsigned int numBytes;
16747  numBytes = 0;
16748  do
16749  {
16750  if( DRV_USART_TRANSFER_STATUS_RECEIVER_DATA_PRESENT & DRV_USART_TransferStatus(myUSARTHandle) )
16751  {
16752  myBuffer[numBytes++] = DRV_USART_ReadByte(myUSARTHandle);
16753  }
16754  // Do something else...
16755  } while( numBytes < MY_BUFFER_SIZE);
16756  </code>
16757  Remarks:
16758  This function is thread safe when called in a RTOS application. Note that
16759  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16760  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16761  DRV_USART_Write functions in a application. Calling the
16762  DRV_USART_ReadByte and DRV_USART_WriteByte functions will disrupt the
16763  processing of any queued buffers.
16764 */
16765 
16766 uint8_t
16768  const DRV_HANDLE handle ) ;
16769 // *****************************************************************************
16770 /* Function:
16771  void DRV_USART_WriteByte( const DRV_HANDLE handle, const uint8_t byte)
16772  Summary:
16773  Writes a byte of data to the USART.
16774  <p><b>Implementation:</b> Static/Dynamic</p>
16775  Description:
16776  This routine writes a byte of data to the USART.
16777  Precondition:
16778  The DRV_USART_Initialize routine must have been called for the specified
16779  USART driver instance.
16780  DRV_USART_Open must have been called to obtain a valid opened device handle.
16781  The transfer status should be checked to see if transmitter is not full
16782  before calling this function.
16783  Parameters:
16784  handle - A valid open-instance handle, returned from the driver's
16785  open routine
16786  byte - Data byte to write to the USART
16787  Returns:
16788  None.
16789  Example:
16790  <code>
16791  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16792  char myBuffer[MY_BUFFER_SIZE];
16793  unsigned int numBytes;
16794  // Preinitialize myBuffer with MY_BUFFER_SIZE bytes of valid data.
16795  numBytes = 0;
16796  while( numBytes < MY_BUFFER_SIZE );
16797  {
16798  if( !(DRV_USART_TRANSFER_STATUS_TRANSMIT_FULL & DRV_USART_TransferStatus(myUSARTHandle)) )
16799  {
16800  DRV_USART_WriteByte(myUSARTHandle, myBuffer[numBytes++]);
16801  }
16802  // Do something else...
16803  }
16804  </code>
16805  Remarks:
16806  This function is thread safe when called in a RTOS application. Note that
16807  DRV_USART_WriteByte and DRV_USART_ReadByte function cannot co-exist with
16808  DRV_USART_BufferAddRead, DRV_USART_BufferAddWrite, DRV_USART_Read and
16809  DRV_USART_Write functions in a application. Calling the
16810  DRV_USART_ReadByte and DRV_USART_WriteByte function will disrupt the
16811  processing of any queued buffers.
16812 */
16813 
16814 void
16816  const DRV_HANDLE handle ,
16817  const uint8_t byte ) ;
16818 // *****************************************************************************
16819 /* Function:
16820  unsigned int DRV_USART_ReceiverBufferSizeGet( const DRV_HANDLE handle )
16821  Summary:
16822  Returns the size of the receive buffer.
16823  <p><b>Implementation:</b> Static/Dynamic</p>
16824  Description:
16825  This routine returns the size of the receive buffer.
16826  Precondition:
16827  The DRV_USART_Initialize routine must have been called for the specified
16828  USART driver instance.
16829  DRV_USART_Open must have been called to obtain a valid opened device handle.
16830  Parameters:
16831  handle - A valid open-instance handle, returned from the driver's
16832  open routine
16833  Returns:
16834  Size of the driver's receive buffer, in bytes.
16835  Example:
16836  <code>
16837  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16838  const uint8_t readBuffer[5];
16839  unsigned int size, numBytes = 0;
16840  unsigned int readbufferLen = sizeof(readBuffer);
16841  size = DRV_USART_ReceiverBufferSizeGet(myUSARTHandle);
16842  // Do something based on the receiver buffer size
16843  </code>
16844  Remarks:
16845  Does not account for client queued buffers. This function is thread safe
16846  when called in a RTOS application.
16847 */
16848 
16849 unsigned int
16851  const DRV_HANDLE handle ) ;
16852 // *****************************************************************************
16853 /* Function:
16854  unsigned int DRV_USART_TransmitBufferSizeGet ( const DRV_HANDLE handle )
16855  Summary:
16856  Returns the size of the transmit buffer.
16857  <p><b>Implementation:</b> Static/Dynamic</p>
16858  Description:
16859  This routine returns the size of the transmit buffer and can be used by the
16860  application to determine the number of bytes to write with the
16861  DRV_USART_WriteByte function.
16862  Precondition:
16863  The DRV_USART_Initialize routine must have been called for the specified
16864  USART driver instance.
16865  DRV_USART_Open must have been called to obtain a valid opened device handle.
16866  Parameters:
16867  handle - A valid open-instance handle, returned from the driver's
16868  open routine
16869  Returns:
16870  Size of the driver's transmit buffer, in bytes.
16871  Examples:
16872  <code>
16873  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16874  const uint8_t writeBuffer[5];
16875  unsigned int size, numBytes = 0;
16876  unsigned int writeBufferLen = sizeof(writeBuffer);
16877  size = DRV_USART_TransmitBufferSizeGet (myUSARTHandle);
16878  // Do something based on the transmitter buffer size
16879  </code>
16880  Remarks:
16881  Does not account for client queued buffers. This function is thread safe
16882  when used in a RTOS application.
16883 */
16884 
16885 unsigned int
16887  const DRV_HANDLE handle ) ;
16888 // *****************************************************************************
16889 /* Function:
16890  bool DRV_USART_ReceiverBufferIsEmpty( const DRV_HANDLE handle )
16891  Summary:
16892  Provides the status of the driver's receive buffer.
16893  <p><b>Implementation:</b> Static/Dynamic</p>
16894  Description:
16895  This routine indicates if the driver's receiver buffer is empty. This
16896  function can be used in conjunction with the DRV_USART_Read and
16897  DRV_USART_ReadByte functions.
16898  Precondition:
16899  The DRV_USART_Initialize routine must have been called for the specified
16900  USART driver instance.
16901  DRV_USART_Open must have been called to obtain a valid opened device handle.
16902  Parameters:
16903  handle - A valid open-instance handle, returned from the driver's
16904  open routine
16905  Returns:
16906  true - if the driver's receive buffer is empty
16907  false - if the driver's receive buffer is not empty
16908  Example:
16909  <code>
16910  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16911  char myBuffer[MY_BUFFER_SIZE];
16912  unsigned int numBytes;
16913  numBytes = 0;
16914  while( numBytes < MY_BUFFER_SIZE );
16915  {
16916  if ( !DRV_USART_ReceiverBufferIsEmpty(myUSARTHandle) )
16917  {
16918  if( numBytes < MY_BUFFER_SIZE )
16919  {
16920  myBuffer[numBytes++] = DRV_USART_ReadByte (myUSARTHandle);
16921  }
16922  else
16923  {
16924  break;
16925  }
16926  }
16927  // Do something else while more data is received.
16928  }
16929  </code>
16930  Remarks:
16931  Does not account for client queued buffers. This function is safe thread
16932  safe when used in a RTOS application.
16933 */
16934 
16935 bool
16937  const DRV_HANDLE handle ) ;
16938 // *****************************************************************************
16939 /* Function:
16940  bool DRV_USART_TransmitBufferIsFull( const DRV_HANDLE handle )
16941  Summary:
16942  Provides the status of the driver's transmit buffer.
16943  <p><b>Implementation:</b> Static/Dynamic</p>
16944  Description:
16945  This routine identifies if the driver's transmit buffer is full or not. This
16946  function can be used in conjunction with the DRV_USART_Write and
16947  DRV_USART_WriteByte functions.
16948  Precondition:
16949  The DRV_USART_Initialize routine must have been called for the specified
16950  USART driver instance.
16951  DRV_USART_Open must have been called to obtain a valid opened device handle.
16952  Parameters:
16953  handle - A valid open-instance handle, returned from the driver's
16954  open routine
16955  Returns:
16956  true - if the transmit buffer is full
16957  false - if the transmit buffer is not full
16958  Example:
16959  <code>
16960  DRV_HANDLE myUSARTHandle; // Returned from DRV_USART_Open
16961  unsigned int numBytes;
16962  int bytesToWrite;
16963  const uint8_t writeBuffer[35] = "1234567890ABCDEFGHIJKLMNOP\n" ;
16964  int writebufferLen = strlen((char *)writeBuffer);
16965  numBytes = 0;
16966  while( numBytes < writebufferLen )
16967  {
16968  if (DRV_USART_TransmitBufferisFull())
16969  {
16970  // Do something else until there is some room in the driver's Transmit buffer.
16971  }
16972  else
16973  {
16974  DRV_USART_WriteByte(myUSARTHandle, writeBuffer[numBytes++]);
16975  }
16976  }
16977  </code>
16978  Remarks:
16979  Does not account for client queued buffers. This function is thread safe
16980  when called in a RTOS application.
16981 */
16982 
16983 bool
16985  const DRV_HANDLE handle ) ;
16986 // *****************************************************************************
16987 /* Function:
16988  void DRV_USART_ByteTransmitCallbackSet
16989  (
16990  const SYS_MODULE_INDEX index,
16991  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
16992  )
16993  Summary:
16994  Registers a callback function for byte transmit event.
16995  Description:
16996  This function allows a transmit callback function to be registered with the
16997  driver. The callback function is invoked when a byte has been transmitted
16998  using DRV_USART_WriteByte () function.
16999  The callback function should be registered with the driver prior to any
17000  writes to the driver. The callback functionality is available only in the
17001  interrupt mode of operation. The driver clears the interrupt after invoking
17002  the callback function.
17003  Precondition:
17004  The DRV_USART_Initialize routine must have been called for the specified
17005  USART driver instance.
17006  Parameters:
17007  index - Identifier for the object instance to be opened
17008  eventHandler - Pointer to the event handler function.
17009  Returns:
17010  None.
17011  Example:
17012  <code>
17013  // myAppObj is an application specific state data object.
17014  MY_APP_OBJ myAppObj;
17015  uint8_t mybuffer[MY_BUFFER_SIZE];
17016  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17017  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17018  (uintptr_t)&myAppObj );
17019  // Register an event handler with driver. This is done once
17020  DRV_USART_ByteTransmitCallbackSet (DRV_USART_INDEX_0, APP_USARTTransmitEventHandler);
17021  DRV_USART_WriteByte (myUSARThandle, myBuffer[0]);
17022  // Event Processing Technique. Event is received when
17023  // the byte is transmitted.
17024  void APP_USARTTransmitEventHandler (const SYS_MODULE_INDEX index)
17025  {
17026  // Byte has been transmitted. Handle the event.
17027  }
17028  </code>
17029  Remarks:
17030  None
17031 */
17032 
17033 void
17035  const SYS_MODULE_INDEX index ,
17036  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17037 // *****************************************************************************
17038 /* Function:
17039  void DRV_USART_ByteReceiveCallbackSet
17040  (
17041  const SYS_MODULE_INDEX index,
17042  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17043  )
17044  Summary:
17045  Registers receive callback function for byte receive event.
17046  Description:
17047  This function allows a receive callback function to be registered with the
17048  driver. The callback function is invoked when a byte has been received. The
17049  received byte can then be read using DRV_USART_ReadByte() function.
17050  The callback function should be registered with the driver as part of the
17051  initialization. The callback functionality is available only in the
17052  interrupt mode of operation. The driver clears the interrupt after invoking
17053  the callback function.
17054  Precondition:
17055  The DRV_USART_Initialize routine must have been called for the specified
17056  USART driver instance.
17057  Parameters:
17058  index - Identifier for the object instance to be opened
17059  eventHandler - Pointer to the event handler function.
17060  Returns:
17061  None.
17062  Example:
17063  <code>
17064  // myAppObj is an application specific state data object.
17065  MY_APP_OBJ myAppObj;
17066  uint8_t mybuffer[MY_BUFFER_SIZE];
17067  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17068  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17069  (uintptr_t)&myAppObj );
17070  // Register an event handler with driver. This is done once
17071  DRV_USART_ByteReceiveCallbackSet(DRV_USART_INDEX_0, APP_USARTReceiveEventHandler);
17072  // Event Processing Technique. Event is received when
17073  // a byte is received.
17074  void APP_USARTReceiveEventHandler(const SYS_MODULE_INDEX index)
17075  {
17076  // Byte has been Received. Handle the event.
17077  // Read byte using DRV_USART_ReadByte ()
17078  // DRV_USART_ReceiverBufferIsEmpty() function can be used to
17079  // check if the receiver buffer is empty.
17080  }
17081  </code>
17082  Remarks:
17083  None
17084 */
17085 
17086 void
17088  const SYS_MODULE_INDEX index ,
17089  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17090 // *****************************************************************************
17091 /* Function:
17092  void DRV_USART_ByteErrorCallbackSet
17093  (
17094  const SYS_MODULE_INDEX index,
17095  const DRV_USART_BYTE_EVENT_HANDLER eventHandler
17096  )
17097  Summary:
17098  Registers callback to handle for byte error events.
17099  Description:
17100  This function allows a callback function to be registered with the driver
17101  to handle the error events occurring in the transmit/receive path during
17102  byte transfers.
17103  The callback function should be registered as part of the initialization.
17104  The callback functionality is available only in the interrupt mode of
17105  operation. The driver clears the interrupt after invoking the callback
17106  function.
17107  Precondition:
17108  The DRV_USART_Initialize routine must have been called for the specified
17109  USART driver instance.
17110  Parameters:
17111  index - Identifier for the object instance to be opened
17112  eventHandler - Pointer to the event handler function.
17113  Returns:
17114  None.
17115  Example:
17116  <code>
17117  // myAppObj is an application specific state data object.
17118  MY_APP_OBJ myAppObj;
17119  uint8_t mybuffer[MY_BUFFER_SIZE];
17120  // myUSARTHandle is the handle returned by the DRV_USART_Open function.
17121  myUSARTHandle = DRV_USART_Open(DRV_USART_INDEX_0, DRV_IO_INTENT_EXCLUSIVE);
17122  (uintptr_t)&myAppObj );
17123  // Register an event handler with driver. This is done once
17124  DRV_USART_ByteErrorCallbackSet (DRV_USART_INDEX_0, APP_USARTErrorEventHandler);
17125  // Event Processing Technique.
17126  void APP_USARTErrorEventHandler(const SYS_MODULE_INDEX index)
17127  {
17128  // Error has occurred. Handle the event.
17129  }
17130  </code>
17131  Remarks:
17132  None
17133 */
17134 
17135 void
17137  const SYS_MODULE_INDEX index ,
17138  const DRV_USART_BYTE_EVENT_HANDLER eventHandler ) ;
17139 // *****************************************************************************
17140 // *****************************************************************************
17141 // Section: USART Driver Setup and Status Routines
17142 // *****************************************************************************
17143 // *****************************************************************************
17144 // *****************************************************************************
17145 /* Function:
17146  DRV_USART_ERROR DRV_USART_ErrorGet(DRV_HANDLE client);
17147  Summary:
17148  This function returns the error(if any) associated with the last client
17149  request.
17150  <p><b>Implementation:</b> Static/Dynamic</p>
17151  Description:
17152  This function returns the error(if any) associated with the last client
17153  request. DRV_USART_Read and DRV_USART_Write will update the client
17154  error status when these functions return DRV_USART_TRANSFER_ERROR. If the
17155  driver send a DRV_USART_BUFFER_EVENT_ERROR to the client, the client can
17156  call this function to know the error cause. The error status will be updated
17157  on every operation and should be read frequently (ideally immediately after
17158  the driver operation has completed) to know the relevant error status.
17159  Precondition:
17160  The DRV_USART_Initialize routine must have been called for the specified
17161  USART driver instance.
17162  DRV_USART_Open must have been called to obtain a valid opened device handle.
17163  Parameters:
17164  bufferhandle - Handle of the buffer of which the processed number of bytes
17165  to be obtained.
17166  Returns:
17167  A DRV_USART_ERROR type indicating last known error status.
17168  Example:
17169  <code>
17170  // myAppObj is an application specific object.
17171  MY_APP_OBJ myAppObj;
17172  uint8_t mybuffer[MY_BUFFER_SIZE];
17173  DRV_USART_BUFFER_HANDLE bufferHandle;
17174  // myUSARTHandle is the handle returned
17175  // by the DRV_USART_Open function.
17176  // Client registers an event handler with driver. This is done once.
17177  DRV_USART_BufferEventHandlerSet( myUSARTHandle, APP_USARTBufferEventHandle,
17178  (uintptr_t)&myAppObj );
17179  bufferHandle = DRV_USART_BufferAddRead( myUSARThandle,
17180  myBuffer, MY_BUFFER_SIZE );
17181  if(DRV_USART_BUFFER_HANDLE_INVALID == bufferHandle)
17182  {
17183  // Error handling here
17184  }
17185  // Event Processing Technique. Event is received when
17186  // the buffer is processed.
17187  void APP_USARTBufferEventHandler( DRV_USART_BUFFER_EVENT event,
17188  DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t contextHandle )
17189  {
17190  // The context handle was set to an application specific
17191  // object. It is now retrievable easily in the event handler.
17192  MY_APP_OBJ myAppObj = (MY_APP_OBJ *) contextHandle;
17193  size_t processedBytes;
17194  switch(event)
17195  {
17196  case DRV_USART_BUFFER_EVENT_COMPLETE:
17197  // This means the data was transferred.
17198  break;
17199  case DRV_USART_BUFFER_EVENT_ERROR:
17200  // Error handling here.
17201  // We can find out how many bytes were processed in this
17202  // buffer before the error occurred. We can also find
17203  // the error cause.
17204  processedBytes = DRV_USART_BufferCompletedBytesGet(bufferHandle);
17205  if(DRV_USART_ERROR_RECEIVE_OVERRUN == DRV_USART_ErrorGet(myUSARTHandle))
17206  {
17207  // There was an receive over flow error.
17208  // Do error handling here.
17209  }
17210  break;
17211  default:
17212  break;
17213  }
17214  }
17215  </code>
17216  Remarks:
17217  It is the client's responsibility to make sure that the error status is
17218  obtained frequently. The driver will update the client error status
17219  regardless of whether this has been examined by the client. This function
17220  is thread safe when used in a RTOS application.
17221 */
17222 
17225  const DRV_HANDLE client ) ;
17226 // *****************************************************************************
17227 /* Function:
17228  void DRV_USART_BaudSet(DRV_HANDLE client, uint32_t baud);
17229  Summary:
17230  This function changes the USART module baud to the specified value.
17231  <p><b>Implementation:</b> Static/Dynamic</p>
17232  Description:
17233  This function changes the USART module baud to the specified value. Any
17234  queued buffer requests will be processed at the updated baud. The USART
17235  driver operates at the baud specified in DRV_USART_Initialize function
17236  unless the DRV_USART_BaudSet function is called to change the baud.
17237  Precondition:
17238  The DRV_USART_Initialize routine must have been called for the specified
17239  USART driver instance.
17240  DRV_USART_Open must have been called to obtain a valid opened device handle.
17241  Parameters:
17242  handle - client handle returned by DRV_USART_Open function.
17243  baud - desired baud.
17244  Returns:
17245  None.
17246  Example:
17247  <code>
17248  // myUSARTHandle is the handle returned
17249  // by the DRV_USART_Open function.
17250  DRV_USART_BaudSet(myUSARTHandle, 9600);
17251  </code>
17252  Remarks:
17253  The implementation of this function, in this release of the driver, changes
17254  the baud immediately. This may interrupt on-going data transfer. It is
17255  recommended that the driver be opened exclusively if this function is to be
17256  called. This function is thread safe when used in a RTOS application.
17257 */
17258 
17261  const DRV_HANDLE client ,
17262  uint32_t baud ) ;
17263 // *****************************************************************************
17264 /* Function:
17265  void DRV_USART_LineControlSet
17266  (
17267  DRV_HANDLE client,
17268  DRV_USART_LINE_CONTROL lineControl
17269  );
17270  Summary:
17271  This function changes the USART module line control to the specified value.
17272  <p><b>Implementation:</b> Static/Dynamic</p>
17273  Description:
17274  This function changes the USART module line control parameters to the
17275  specified value. Any queued buffer requests will be processed at the
17276  updated line control parameters. The USART driver operates at the line
17277  control parameters specified in DRV_USART_Initialize function unless the
17278  DRV_USART_LineControlSet function is called to change the line control
17279  parameters.
17280  Precondition:
17281  The DRV_USART_Initialize routine must have been called for the specified
17282  USART driver instance.
17283  DRV_USART_Open must have been called to obtain a valid opened device handle.
17284  Parameters:
17285  handle - client handle returned by DRV_USART_Open function.
17286  lineControl - line control parameters.
17287  Returns:
17288  DRV_USART_LINE_CONTROL_SET_SUCCESS if the function was successful. Returns
17289  DRV_HANDLE_INVALID if the client handle is not valid.
17290  Example:
17291  <code>
17292  // myUSARTHandle is the handle returned
17293  // by the DRV_USART_Open function.
17294  DRV_USART_LineControlSet(myUSARTHandle, DRV_USART_LINE_CONTROL_8NONE1);
17295  </code>
17296  Remarks:
17297  The implementation of this function, in this release of the driver, changes
17298  the line control immediately. This may interrupt on-going data transfer. It
17299  is recommended that the driver be opened exclusively if this function is to
17300  be called. This function is thread safe when called in a RTOS application.
17301 */
17302 
17305  const DRV_HANDLE client ,
17306  const DRV_USART_LINE_CONTROL lineControl ) ;
17307 //DOM-IGNORE-BEGIN
17308 //DOM-IGNORE-END
17309  // #ifndef _DRV_USART_H
17310 /*******************************************************************************
17311  End of File
17312 */
17313 
17314 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\drv_usart.h*/
17315 /* CLOSE_FILE Include File */
17316 
17317 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h */
17318 /*******************************************************************************
17319  USART Driver Variant Mapping
17320  Company:
17321  Microchip Technology Inc.
17322  File Name:
17323  drv_usart_variant_mapping.h
17324  Summary:
17325  USART Driver Variant Mapping
17326  Description:
17327  This file provides feature and build variant mapping macros allowing the
17328  driver to easily be built with different implementation variations based
17329  on static build-time configuration selections.
17330 *******************************************************************************/
17331 //DOM-IGNORE-BEGIN
17332 /*******************************************************************************
17333 Copyright (c) 2012 released Microchip Technology Inc. All rights reserved.
17334 Microchip licenses to you the right to use, modify, copy and distribute
17335 Software only when embedded on a Microchip microcontroller or digital signal
17336 controller that is integrated into your product or third party product
17337 (pursuant to the sublicense terms in the accompanying license agreement).
17338 You should refer to the license agreement accompanying this Software for
17339 additional information regarding your rights and obligations.
17340 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17341 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17342 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17343 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17344 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17345 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17346 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17347 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17348 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17349 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17350 *******************************************************************************/
17351 //DOM-IGNORE-END
17352 #ifndef _DRV_USART_FEATURE_MAPPING_H
17353 #define _DRV_USART_FEATURE_MAPPING_H
17354 // *****************************************************************************
17355 // *****************************************************************************
17356 // Section: Interrrupt Variations
17357 // *****************************************************************************
17358 // *****************************************************************************
17359 /* Mapping of the interrupt mode variations
17360 */
17361  /* Driver is configured for polled mode */
17362 #define _DRV_USART_InterruptSourceIsEnabled( source ) false
17363 #define _DRV_USART_InterruptSourceEnable( source )
17364 #define _DRV_USART_InterruptSourceDisable( source ) false
17365 #define _DRV_USART_InterruptSourceStatusClear( source ) SYS_INT_SourceStatusClear ( source )
17366 #define _DRV_USART_SEM_POST( x ) OSAL_SEM_Post ( x )
17367 #define _DRV_USART_TAKE_MUTEX( x , y ) OSAL_MUTEX_Lock ( x , y )
17368 #define _DRV_USART_RELEASE_MUTEX( x ) OSAL_MUTEX_Unlock ( x )
17369 #define _SYS_DMA_ChannelForceStart( channelHandle ) SYS_DMA_ChannelForceStart ( channelHandle )
17370  /* This means the driver is being built in a baremetal application.
17371  We cannot let a client open the driver in blocking mode */
17372 #define _DRV_USART_ALWAYS_NON_BLOCKING ( DRV_IO_INTENT_NONBLOCKING )
17373 // *****************************************************************************
17374 // *****************************************************************************
17375 // Section: Buffer Queue support
17376 // *****************************************************************************
17377 // *****************************************************************************
17378 /* Mapping of macros for buffer queue support
17379 */
17380  /* We dont need buffer queues or byte model support */
17381 #define _DRV_USART_TRANSMIT_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteTransmitTasks ( x )
17382 #define _DRV_USART_RECEIVE_BUFFER_QUEUE_TASKS( x ) _DRV_USART_ByteReceiveTasks ( x )
17383 #define _DRV_USART_ERROR_TASKS( x ) _DRV_USART_ByteErrorTasks ( x )
17384 #define _DRV_USART_CLIENT_BUFFER_QUEUE_OBJECTS_REMOVE( x ) true
17385 #define _DRV_USART_ByteModelInterruptSourceEnable( source )
17386 // *****************************************************************************
17387 // *****************************************************************************
17388 // Initializtion Parameter Static Overrides
17389 // *****************************************************************************
17390 // *****************************************************************************
17391  //_DRV_USART_FEATURE_MAPPING_H
17392 /*******************************************************************************
17393  End of File
17394 */
17395 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\usart\src\drv_usart_variant_mapping.h*/
17396 /* CLOSE_FILE Include File */
17397 
17398 #include "system/clk/sys_clk.h"
17399 #include "system/int/sys_int.h"
17400 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h */
17401 /*******************************************************************************
17402  Debug System Services Library Header
17403  Company:
17404  Microchip Technology Inc.
17405 
17406  File Name:
17407  sys_debug.h
17408  Summary:
17409  Defines the common debug definitions and interfaces used by MPLAB Harmony
17410  libraries to report errors and debug information to the user.
17411  Description:
17412  This header file defines the common debug definitions and interface macros
17413  (summary below) and prototypes used by MPLAB Harmony libraries to report
17414  errors and debug information to the user.
17415  *******************************************************************************/
17416 //DOM-IGNORE-BEGIN
17417 /*******************************************************************************
17418 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
17419 Microchip licenses to you the right to use, modify, copy and distribute
17420 Software only when embedded on a Microchip microcontroller or digital signal
17421 controller that is integrated into your product or third party product
17422 (pursuant to the sublicense terms in the accompanying license agreement).
17423 You should refer to the license agreement accompanying this Software for
17424 additional information regarding your rights and obligations.
17425 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
17426 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
17427 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
17428 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
17429 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
17430 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
17431 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
17432 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
17433 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
17434 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
17435  *******************************************************************************/
17436 //DOM-IGNORE-END
17437 #ifndef _SYS_DEBUG_H
17438 #define _SYS_DEBUG_H
17439 #include "C:\microchip\harmony\v2_06\framework\system\system.h"
17440  /* LDRA full path */
17441 // This should be defined in system_config.h. It is added here as a build safe-guard.
17442 #define SYS_DEBUG_BUFFER_DMA_READY
17443 // *****************************************************************************
17444 // *****************************************************************************
17445 // Section: SYS DEBUG Data Types
17446 // *****************************************************************************
17447 // *****************************************************************************
17448 // *****************************************************************************
17449 /* SYS_ERROR_LEVEL enumeration
17450  Summary:
17451  System error message priority levels.
17452  Description:
17453  This enumeration defines the supported system error message priority values.
17454  Remarks:
17455  Used by debug message macros to compare individual message priority against
17456  a global system-wide error message priority level to determine if an
17457  individual message should be displayed.
17458 */
17459 
17460 typedef
17461  enum
17462  {
17463  /* Errors that have the potential to cause a system crash. */
17465  /* Errors that have the potential to cause incorrect behavior. */
17467  /* Warnings about potentially unexpected behavior or side effects. */
17469  /* Information helpful to understanding potential errors and warnings. */
17471  /* Verbose information helpful during debugging and testing. */
17473  } SYS_ERROR_LEVEL ;
17474 // DOM-IGNORE-BEGIN
17475 // *****************************************************************************
17476 /* Do not use this variable directly. Use SYS_DEBUG_ErrorLevelGet or
17477  SYS_DEBUG_ErrorLevelSet functions to access this value.
17478 */
17479 
17480 extern SYS_ERROR_LEVEL
17481  gblErrLvl ;
17482 // DOM-IGNORE-END
17483 // *****************************************************************************
17484 /* SYS Debug Module Index Number
17485  Summary:
17486  Debug System Service index.
17487  Description:
17488  This constant defines a symbolic name for the debug system service index.
17489  Remarks:
17490  There can only be a single debug system service instance in the system.
17491 */
17492 #define SYS_DEBUG_INDEX_0 0
17493 // *****************************************************************************
17494 /* SYS Debug Initialize structure
17495  Summary:
17496  Defines the data required to initialize the debug system service.
17497  Description:
17498  This structure defines the data required to initialize the debug system
17499  service.
17500  Remarks:
17501  None.
17502 */
17503 
17504 typedef
17505  struct
17506  {
17507  /* System module initialization */
17508  SYS_MODULE_INIT moduleInit ;
17509  /* Initial system error level setting. */
17510  SYS_ERROR_LEVEL errorLevel ;
17511  /* Console index to receive debug messages */
17512  SYS_MODULE_INDEX consoleIndex ;
17513  } SYS_DEBUG_INIT ;
17514 // *****************************************************************************
17515 // *****************************************************************************
17516 // Section: SYS DEBUG Functions
17517 // *****************************************************************************
17518 // *****************************************************************************
17519 // *****************************************************************************
17520 /* Function:
17521  SYS_MODULE_OBJ SYS_DEBUG_Initialize( const SYS_MODULE_INDEX index,
17522  const SYS_MODULE_INIT * const init )
17523  Summary:
17524  Initializes the global error level and specific module instance.
17525  Description:
17526  This function initializes the global error level. It also initializes any
17527  internal system debug module data structures.
17528  Precondition:
17529  None.
17530  Parameters:
17531  index - Index for the instance to be initialized
17532  init - Pointer to a data structure containing any data necessary
17533  to initialize the debug service. This pointer may be null
17534  if no data is required because static overrides have
17535  been provided.
17536  Returns:
17537  If successful, returns a valid handle to an object. Otherwise, it
17538  returns SYS_MODULE_OBJ_INVALID.
17539  Example:
17540  <code>
17541  SYS_MODULE_OBJ objectHandle;
17542  SYS_DEBUG_INIT debugInit =
17543  {
17544  .moduleInit = {0},
17545  .errorLevel = SYS_ERROR_DEBUG,
17546  };
17547  objectHandle = SYS_Debug_Initialize (SYS_DEBUG_CONSOLE, (SYS_MODULE_INIT*)&debugInit);
17548  if (SYS_MODULE_OBJ_INVALID == objectHandle)
17549  {
17550  // Handle error
17551  }
17552  </code>
17553  Remarks:
17554  This routine should only be called once during system initialization. If the
17555  system was already initialized it safely returns without causing any disturbance.
17556 */
17557 
17558 SYS_MODULE_OBJ
17560  const SYS_MODULE_INDEX index ,
17561  const SYS_MODULE_INIT * const init ) ;
17562 // *****************************************************************************
17563 /* Function:
17564  void SYS_DEBUG_Reinitialize( SYS_MODULE_OBJ object,
17565  const SYS_MODULE_INIT * const init )
17566  Summary:
17567  Reinitializes and refreshes the data structure for the instance of the
17568  Debug module.
17569  Description:
17570  This function reinitializes and refreshes the data structure for the instance
17571  of the Debug module using the supplied data.
17572  Precondition:
17573  The SYS_DEBUG_Initialize function should have been called before calling
17574  this function.
17575  Parameters:
17576  object - Identifies the SYS DEBUG Object returned by the Initialize
17577  interface
17578  init - Pointer to the data structure containing any data
17579  necessary to initialize the hardware
17580  Returns:
17581  None
17582  Example:
17583  <code>
17584  SYS_MODULE_OBJ objectHandle;
17585  // Populate the console initialization structure
17586  SYS_DEBUG_INIT dbgInit =
17587  {
17588  .moduleInit = {0},
17589  .errorLevel = SYS_ERROR_DEBUG,
17590  };
17591  SYS_DEBUG_Reinitialize (objectHandle, (SYS_MODULE_INIT*)&dbgInit);
17592  </code>
17593  Remarks:
17594  This operation uses the same initialization data structure as the
17595  SYS_DEBUG_Initialize operation. This function can be called multiple times
17596  to reinitialize the module.
17597 */
17598 
17599 void
17601  SYS_MODULE_OBJ object ,
17602  const SYS_MODULE_INIT * const init ) ;
17603 // *****************************************************************************
17604 /* Function:
17605  void SYS_DEBUG_Deinitialize( SYS_MODULE_OBJ object )
17606  Summary:
17607  Deinitializes the specific module instance of the Debug module.
17608  Description:
17609  This function deinitializes the specific module instance disabling its
17610  operation (and any hardware for driver modules). Resets all of the internal
17611  data structures and fields for the specified instance to the default settings.
17612  Precondition:
17613  The SYS_DEBUG_Initialize function should have been called before calling
17614  this function.
17615  Parameters:
17616  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17617  Returns:
17618  None.
17619  Example:
17620  <code>
17621  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17622  SYS_DEBUG_Deinitialize (object);
17623  </code>
17624  Remarks:
17625  Once the Initialize operation has been called, the Deinitialize
17626  operation must be called before the Initialize operation can be called
17627  again.
17628 */
17629 
17630 void
17632  SYS_MODULE_OBJ object ) ;
17633 // *****************************************************************************
17634 /* Function:
17635  void SYS_DEBUG_Tasks( SYS_MODULE_OBJ object )
17636  Summary:
17637  Maintains the debug module's state machine.
17638  Description:
17639  This function is used to maintain the debug module's internal state
17640  machine and implement its ISR for interrupt-driven implementations.
17641  Precondition:
17642  The SYS_DEBUG_Initialize function must have been called for the specified
17643  CONSOLE driver instance.
17644  Parameters:
17645  object - SYS DEBUG object handle, returned from SYS_DEBUG_Initialize
17646  Returns:
17647  None.
17648  Example:
17649  <code>
17650  SYS_MODULE_OBJ object; // Returned from SYS_DEBUG_Initialize
17651  while (true)
17652  {
17653  SYS_DEBUG_Tasks (object);
17654  // Do other tasks
17655  }
17656  </code>
17657  Remarks:
17658  This function is normally not called directly by an application. It is
17659  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
17660  ISR.
17661 */
17662 
17663 void
17664  SYS_DEBUG_Tasks (
17665  SYS_MODULE_OBJ object ) ;
17666 // *****************************************************************************
17667 /* Function:
17668  SYS_STATUS SYS_DEBUG_Status( SYS_MODULE_OBJ object )
17669  Summary:
17670  Returns status of the specific instance of the debug service module.
17671  Description:
17672  This function returns the status of the specific debug service module
17673  instance.
17674  Precondition:
17675  The SYS_CONSOLE_Initialize function should have been called before calling
17676  this function.
17677  Parameters:
17678  object - Debug module object handle, returned from SYS_DEBUG_Initialize
17679  Returns:
17680  * SYS_STATUS_READY - Indicates that the module is running and
17681  ready to service requests. Any value greater
17682  than SYS_STATUS_READY is also a normal
17683  running state in which the module is ready
17684  to accept new operations.
17685  * SYS_STATUS_BUSY - Indicates that the module is busy with a
17686  previous system level operation and cannot
17687  start another.
17688  * SYS_STATUS_ERROR - Indicates that the module is in an error
17689  state. Any value less than SYS_STATUS_ERROR
17690  is also an error state.
17691  * SYS_STATUS_UNINITIALIZED - Indicates that the module has not been
17692  initialized or has been deinitialized.
17693  Example:
17694  <code>
17695  SYS_MODULE_OBJ object; // Returned from SYS_CONSOLE_Initialize
17696  SYS_STATUS debugStatus;
17697  debugStatus = SYS_DEBUG_Status (object);
17698  if (SYS_STATUS_ERROR >= debugStatus)
17699  {
17700  // Handle error
17701  }
17702  </code>
17703  Remarks:
17704  None.
17705 */
17706 
17707 SYS_STATUS
17709  SYS_MODULE_OBJ object ) ;
17710 // *****************************************************************************
17711 // *****************************************************************************
17712 // Section: SYS DEBUG Console Functions
17713 // *****************************************************************************
17714 // *****************************************************************************
17715 // *****************************************************************************
17716 /* Function:
17717  SYS_DEBUG_Message( const char* message );
17718  Summary:
17719  Prints a message to the console regardless of the system error level.
17720  Description:
17721  This function prints a message to the console regardless of the system
17722  error level. It can be used as an implementation of the SYS_MESSAGE and
17723  SYS_DEBUG_MESSAGE macros.
17724  Precondition:
17725  SYS_DEBUG_Initialize must have returned a valid object handle and the
17726  SYS_DEBUG_Tasks function must be called by the system to complete the
17727  message request.
17728  Parameters:
17729  message - Pointer to a message string to be displayed.
17730  Returns:
17731  None.
17732  Example:
17733  <code>
17734  // In system_config.h:
17735 #define SYS_MESSAGE(message) SYS_DEBUG_Message(message)
17736 
17737  // In source (.c) files:
17738  SYS_MESSAGE("My Message\n\r");
17739  </code>
17740  Remarks:
17741  Do not call this function directly. Call the SYS_MESSAGE or
17742  SYS_DEBUG_MESSAGE macros instead.
17743 
17744  The default SYS_MESSAGE and SYS_DEBUG_MESSAGE macro definitions remove
17745  the messages and message function calls from the source code. To access
17746  and utilize the messages, define the SYS_DEBUG_USE_CONSOLE macro or
17747  override the definitions of the individual macros.
17748 */
17749 
17750 void
17752  const char * message ) ;
17753 // *****************************************************************************
17754 /* Function:
17755  SYS_DEBUG_Print( const char* format, ... )
17756  Summary:
17757  Formats and prints a message with a variable number of arguments to the
17758  console regardless of the system error level.
17759  Description:
17760  This function formats and prints a message with a variable number of
17761  arguments to the console regardless of the system error level. It can be
17762  used to implement the SYS_PRINT and SYS_DEBUG_PRINT macros.
17763  Precondition:
17764  SYS_DEBUG_Initialize must have returned a valid object handle and the
17765  SYS_DEBUG_Tasks function must be called by the system to complete the
17766  message request.
17767  Parameters:
17768  format - Pointer to a buffer containing the format string for
17769  the message to be displayed.
17770  ... - Zero or more optional parameters to be formated as
17771  defined by the format string.
17772  Returns:
17773  None.
17774  Example:
17775  <code>
17776  // In system_config.h
17777 #define SYS_PRINT(format, ...) SYS_DEBUG_Print(format, ##__VA_ARG__)
17778 
17779  // In source code
17780  int result;
17781 
17782  result = SomeOperation();
17783  if (result > MAX_VALUE)
17784  {
17785  SYS_PRINT("Result of %d exceeds max value\r\n", result);
17786  }
17787  </code>
17788  Remarks:
17789  The format string and arguments follow the printf convention.
17790 
17791  Do not call this function directly. Call the SYS_PRINT or SYS_DEBUG_PRINT
17792  macros instead.
17793 
17794  The default SYS_PRINT and SYS_DEBUG_PRINT macro definitions remove the
17795  messages and message function calls. To access and utilize the messages,
17796  define the SYS_DEBUG_USE_CONSOLE macro or override the definitions of the
17797  individual macros.
17798 */
17799 
17800 void
17801  SYS_DEBUG_Print (
17802  const char * format ,
17803  ... ) ;
17804 // *****************************************************************************
17805 /* Function:
17806  void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level);
17807  Summary:
17808  Sets the global system error reporting level.
17809  Description:
17810  This function sets the global system error reporting level.
17811 
17812  Precondition:
17813  SYS_DEBUG_Initialize must have returned a valid object handle.
17814  Parameters:
17815  level - The desired system error level.
17816  Returns:
17817  None.
17818  Example:
17819  <code>
17820  SYS_DEBUG_ErrorLevelSet(SYS_ERROR_WARNING);
17821  </code>
17822  Remarks:
17823  None.
17824 */
17825 
17826 void
17828  SYS_ERROR_LEVEL level ) ;
17829 // *****************************************************************************
17830 /* Function:
17831  SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void);
17832  Summary:
17833  Returns the global system Error reporting level.
17834  Description:
17835  This function returns the global System Error reporting level.
17836 
17837  Precondition:
17838  SYS_DEBUG_Initialize must have returned a valid object handle.
17839  Parameters:
17840  None.
17841  Returns:
17842  The global System Error Level.
17843  Example:
17844  <code>
17845  SYS_ERROR_LEVEL level;
17846 
17847  level = SYS_DEBUG_ErrorLevelGet();
17848  </code>
17849  Remarks:
17850  None.
17851 */
17852 
17854  SYS_DEBUG_ErrorLevelGet ( void ) ;
17855 // *****************************************************************************
17856 // *****************************************************************************
17857 // Section: SYS DEBUG Macros
17858 // *****************************************************************************
17859 // *****************************************************************************
17860 // *****************************************************************************
17861 /* Macro:
17862  _SYS_DEBUG_MESSAGE( SYS_ERROR_LEVEL level, const char* message )
17863  Summary:
17864  Prints a debug message if the specified level is at or below the global
17865  system error level.
17866  Description:
17867  This macro prints a debug message if the specified level is at or below the
17868  global error level. It can be used to implement the SYS_DEBUG_MESSAGE macro.
17869  Precondition:
17870  SYS_DEBUG_Initialize must have returned a valid object handle.
17871  Parameters:
17872  level - The current error level threshold for displaying the message.
17873  message - Pointer to a buffer containing the message to be displayed.
17874  Returns:
17875  None.
17876  Example:
17877  <code>
17878  // In system_config.h
17879 #define SYS_DEBUG_MESSAGE(level,message) _SYS_DEBUG_MESSAGE(level,message)
17880 
17881  // In library source (.c) code.
17882  SYS_DEBUG_MESSAGE(SYS_ERROR_WARNING, "My debug warning message\n\r");
17883  </code>
17884  Remarks:
17885  Do not call this macro directly. Call the SYS_DEBUG_MESSAGE macro instead.
17886 
17887  The default SYS_DEBUG_MESSAGE macro definition removes the message and
17888  function call from the source code. To access and utilize the message,
17889  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17890  SYS_DEBUG_MESSAGE macro.
17891 */
17892 #define _SYS_DEBUG_MESSAGE( level , message ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Message ( message ) ; } while ( 0 )
17893 // *****************************************************************************
17894 /* Macro:
17895  _SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
17896  Summary:
17897  Formats and prints a debug message if the specified level is at or below the
17898  global system error level.
17899  Description:
17900  This function formats and prints a debug message if the specified level is
17901  at or below the global system error level. It can be used to implement the
17902  SYS_DEBUG_PRINT macro.
17903  Precondition:
17904  SYS_DEBUG_Initialize must have returned a valid object handle.
17905  Parameters:
17906  level - The current error level threshold for displaying the message.
17907  format - Pointer to a buffer containing the format string for
17908  the message to be displayed.
17909  ... - Zero or more optional parameters to be formated as
17910  defined by the format string.
17911  Returns:
17912  None.
17913  Example:
17914  <code>
17915  // In system_config.h
17916 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
17917 
17918  // In source code
17919  int result;
17920 
17921  result = SomeOperation();
17922  if (result > MAX_VALUE)
17923  {
17924  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
17925  // Take appropriate action
17926  }
17927  </code>
17928  Remarks:
17929  Do not call this macro directly. Call the SYS_DEBUG_PRINT macro instead.
17930 
17931  The default SYS_DEBUG_PRINT macro definition removes the message and
17932  function call from the source code. To access and utilize the message,
17933  define the SYS_DEBUG_USE_CONSOLE macro or override the definition of the
17934  SYS_DEBUG_PRINT macro.
17935 */
17936 #define _SYS_DEBUG_PRINT( level , format ,... ) do { if ( ( level ) <= SYS_DEBUG_ErrorLevelGet ( ) ) SYS_DEBUG_Print ( format , ## __VA_ARGS__ ) ; } while ( 0 )
17937 // DOM-IGNORE-BEGIN
17938 // *****************************************************************************
17939 /* These definitions support the SYS_DEBUG_USE_CONSOLE build-time configuration
17940  option. Defining SYS_DEBUG_USE_CONSOLE in the system configuration
17941  (system_config.h) will map the macros below to the appropriate system
17942  console functions.
17943 */
17944 // DOM-IGNORE-END
17945 // *****************************************************************************
17946 /* Macro:
17947  SYS_MESSAGE( const char* message )
17948  Summary:
17949  Prints a message to the console regardless of the system error level.
17950  Description:
17951  This macro is used to print a message to the console regardless of the
17952  system error level. It can be mapped to any desired implementation.
17953  Precondition:
17954  If mapped to the _SYS_MESSAGE function, then the system debug service must
17955  be initialized and running.
17956  Parameters:
17957  message - Pointer to a buffer containing the message string to be
17958  displayed.
17959  Returns:
17960  None.
17961  Example:
17962  <code>
17963  // In system_config.h:
17964 #define SYS_MESSAGE(message) _SYS_MESSAGE(message)
17965 
17966  // In source (.c) files:
17967  SYS_MESSAGE("My Message\n\r");
17968  </code>
17969  Remarks:
17970  By default, this macro is defined as nothing, effectively removing all code
17971  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
17972  defined in a way that maps calls to it to the desired implementation (see
17973  example, above).
17974 
17975  This macro can be mapped to the system console service (along with other
17976  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
17977  configuration (system_config.h) instead of defining it individually.
17978 */
17979 #define SYS_MESSAGE( message )
17980 // *****************************************************************************
17981 /* Function:
17982  SYS_DEBUG_MESSAGE( const char* message )
17983  Summary:
17984  Prints a debug message if the system error level is defined defined at
17985  or lower than the level specified.
17986  Description:
17987  This function prints a debug message if the system error level is defined at
17988  or lower than the level specified.
17989  Precondition:
17990  SYSTEM_CURRENT_ERROR_LEVEL must be defined as SYS_ERROR_DEBUG.
17991  Parameters:
17992  level - The current error level threshold for displaying the message.
17993  message - Pointer to a buffer containing the message to be displayed.
17994  Returns:
17995  None.
17996  Example:
17997  <code>
17998 #define SYS_DEBUG_MESSAGE _SYS_DEBUG_MESSAGE
17999  SYS_ERROR_LevelSet(SYS_ERROR_DEBUG);
18000  SYS_DEBUG_MESSAGE("System Debug Message \n\r");
18001  </code>
18002  Remarks:
18003  By default, this macro is defined as nothing, effectively removing all code
18004  generated by calls to it. To process SYS_DEBUG_MESSAGE calls, this macro
18005  must be defined in a way that maps calls to it to the desired implementation
18006  (see example, above).
18007 
18008  This macro can be mapped to the system console service (along with other
18009  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18010  configuration (system_config.h) instead of defining it individually.
18011 */
18012 #define SYS_DEBUG_MESSAGE( level , message )
18013 // *****************************************************************************
18014 /* Function:
18015  SYS_PRINT(const char* format, ...);
18016  Summary:
18017  Formats and prints an error message with a variable number of arguments
18018  regardless of the system error level.
18019  Description:
18020  This function formats and prints an error message with a variable number of
18021  if the system error level is defined at or lower than the level specified.
18022  Precondition:
18023  SYSTEM_CURRENT_ERROR_LEVEL must be defined.
18024  Parameters:
18025  format - Pointer to a buffer containing the format string for
18026  the message to be displayed.
18027  ... - Zero or more optional parameters to be formated as
18028  defined by the format string.
18029  Returns:
18030  None.
18031  Example:
18032  <code>
18033  // In system_config.h
18034 #define SYS_PRINT(format, ...) _SYS_DEBUG_PRINT(format, ##__VA_ARG__)
18035 
18036  // In source code
18037  int result;
18038 
18039  result = SomeOperation();
18040  if (result > MAX_VALUE)
18041  {
18042  SYS_PRINT("Result of %d exceeds max value\r\n", result);
18043  // Take appropriate action
18044  }
18045  </code>
18046  Remarks:
18047  The format string and arguments follow the printf convention. This function
18048  is called by the macros SYS_PRINT and SYS_ERROR_PRINT
18049 
18050  By default, this macro is defined as nothing, effectively removing all code
18051  generated by calls to it. To process SYS_PRINT calls, this macro must be
18052  defined in a way that maps calls to it to the desired implementation (see
18053  example, above).
18054 
18055  This macro can be mapped to the system console service (along with other
18056  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18057  configuration (system_config.h) instead of defining it individually.
18058 */
18059 #define SYS_PRINT( fmt ,... )
18060 // *****************************************************************************
18061 /* Macro:
18062  SYS_DEBUG_PRINT( SYS_ERROR_LEVEL level, const char* format, ... )
18063  Summary:
18064  Formats and prints an error message if the system error level is defined at
18065  or lower than the level specified.
18066  Description:
18067  This macro formats and prints an error message if the system error level
18068  is defined at or lower than the level specified.o
18069  Precondition:
18070  SYS_DEBUG_Initialize must have returned a valid object handle.
18071  Parameters:
18072  level - The current error level threshold for displaying the message.
18073  format - Pointer to a buffer containing the format string for
18074  the message to be displayed.
18075  ... - Zero or more optional parameters to be formated as
18076  defined by the format string.
18077  Returns:
18078  None.
18079  Example:
18080  <code>
18081  // In system_config.h
18082 #define SYS_DEBUG_PRINT(level, format, ...) _SYS_DEBUG_PRINT(level, format, ##__VA_ARG__)
18083 
18084  // In source code
18085  int result;
18086 
18087  result = SomeOperation();
18088  if (result > MAX_VALUE)
18089  {
18090  SYS_DEBUG_PRINT(SYS_ERROR_WARNING, "Result of %d exceeds max value\r\n", result);
18091  // Take appropriate action
18092  }
18093  </code>
18094  Remarks:
18095  The format string and arguments follow the printf convention. This function
18096  is called by the macros SYS_PRINT and SYS_DEBUG_PRINT.
18097 
18098  By default, this macro is defined as nothing, effectively removing all code
18099  generated by calls to it. To process SYS_MESSAGE calls, this macro must be
18100  defined in a way that maps calls to it to the desired implementation (see
18101  example, above).
18102 
18103  This macro can be mapped to the system console service (along with other
18104  system debug macros) by defining SYS_DEBUG_USE_CONSOLE in the system
18105  configuration (system_config.h) instead of defining it individually.
18106 */
18107 #define SYS_DEBUG_PRINT( level , fmt ,... )
18108 // *****************************************************************************
18109 /* Macro:
18110  SYS_DEBUG_BreakPoint( void )
18111  Summary:
18112  Inserts a software breakpoint instruction when building in Debug mode.
18113  Description:
18114  This macro inserts a software breakpoint instruction when building in Debug
18115  mode.
18116  Precondition:
18117  None.
18118  Parameters:
18119  None.
18120  Returns:
18121  None.
18122  Example:
18123  <code>
18124  if (myDebugTestFailed)
18125  {
18126  SYS_DEBUG_BreakPoint();
18127  }
18128  </code>
18129  Remarks:
18130  Compiles out if not built for debugging.
18131 */
18132 #define SYS_DEBUG_BreakPoint( )
18133 // *****************************************************************************
18134 // *****************************************************************************
18135 // Section: SYS DEBUG Deprecated Macros
18136 // *****************************************************************************
18137 // *****************************************************************************
18138 /* Do not use these macros for new development.
18139 */
18140 //DOM-IGNORE-BEGIN
18141 #define SYS_DEBUG( level , message ) SYS_DEBUG_MESSAGE ( level , message )
18142 #define SYS_ERROR( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18143 #define SYS_ERROR_PRINT( level , fmt ,... ) SYS_DEBUG_PRINT ( level , fmt , ## __VA_ARGS__ )
18144 //DOM-IGNORE-END
18145  // _SYS_DEBUG_H
18146 /*******************************************************************************
18147  End of File
18148 */
18149 #endif /*00 C:\microchip\harmony\v2_06\framework\system\debug\sys_debug.h*/
18150 /* CLOSE_FILE Include File */
18151 
18152 // DOM-IGNORE-BEGIN
18153 // DOM-IGNORE-END
18154 // *****************************************************************************
18155 // *****************************************************************************
18156 // Section: Data Type Definitions
18157 // *****************************************************************************
18158 // *****************************************************************************
18159 /* USART FIFO+RX(8+1) size */
18160 #define _DRV_USART_RX_DEPTH 9
18161 // *****************************************************************************
18162 /* USART Static Driver Instance Object
18163  Summary:
18164  Object used to keep any data required for the static USART driver.
18165  Description:
18166  This object is used to keep track of any data that must be maintained to
18167  manage the USART static driver.
18168  Remarks:
18169  None.
18170 */
18171 
18172 typedef
18173  struct
18174  {
18175  /* Client specific error */
18176  DRV_USART_ERROR error ;
18177  } DRV_USART_OBJ ;
18178 // *****************************************************************************
18179 // *****************************************************************************
18180 // Section: Local functions.
18181 // *****************************************************************************
18182 // *****************************************************************************
18183 // DOM-IGNORE-BEGIN
18184 // DOM-IGNORE-END
18185  //#ifndef _DRV_USART_STATIC_LOCAL_H
18186 /*******************************************************************************
18187  End of File
18188 */
18189 
18190 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\src\drv_usart_static_local.h*/
18191 /* CLOSE_FILE Include File */
18192 
18193 // DOM-IGNORE-BEGIN
18194 // DOM-IGNORE-END
18195 // *********************************************************************************************
18196 // *********************************************************************************************
18197 // Section: System Interface Headers for the Instance 0 of USART static driver
18198 // *********************************************************************************************
18199 // *********************************************************************************************
18200 
18201 SYS_MODULE_OBJ
18202  DRV_USART0_Initialize ( void ) ;
18203 
18204 void
18205  DRV_USART0_Deinitialize ( void ) ;
18206 
18207 SYS_STATUS
18208  DRV_USART0_Status ( void ) ;
18209 
18210 void
18211  DRV_USART0_TasksTransmit ( void ) ;
18212 
18213 void
18214  DRV_USART0_TasksReceive ( void ) ;
18215 
18216 void
18217  DRV_USART0_TasksError ( void ) ;
18218 // *********************************************************************************************
18219 // *********************************************************************************************
18220 // Section: General Client Interface Headers for the Instance 0 of USART static driver
18221 // *********************************************************************************************
18222 // *********************************************************************************************
18223 
18224 DRV_HANDLE
18225  DRV_USART0_Open (
18226  const SYS_MODULE_INDEX index ,
18227  const DRV_IO_INTENT ioIntent ) ;
18228 
18229 void
18230  DRV_USART0_Close ( void ) ;
18231 
18233  DRV_USART0_ClientStatus ( void ) ;
18234 
18236  DRV_USART0_TransferStatus ( void ) ;
18237 
18239  DRV_USART0_ErrorGet ( void ) ;
18240 // *********************************************************************************************
18241 // *********************************************************************************************
18242 // Section: Byte Model Client Interface Headers for the Instance 0 of USART static driver
18243 // *********************************************************************************************
18244 // *********************************************************************************************
18245 
18246 uint8_t
18247  DRV_USART0_ReadByte ( void ) ;
18248 
18249 void
18251  const uint8_t byte ) ;
18252 
18253 unsigned int
18255 
18256 unsigned int
18258 
18259 bool
18261 
18262 bool
18264 // *********************************************************************************************
18265 // *********************************************************************************************
18266 // Section: Set up Client Interface Headers for the Instance 0 of USART static driver
18267 // *********************************************************************************************
18268 // *********************************************************************************************
18269 
18272  uint32_t baud ) ;
18273 
18276  DRV_USART_LINE_CONTROL lineControlMode ) ;
18277 // DOM-IGNORE-BEGIN
18278 // DOM-IGNORE-END
18279  // #ifndef _DRV_USART_STATIC_H
18280 /*******************************************************************************
18281  End of File
18282 */
18283 
18284 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\framework\driver\usart\drv_usart_static.h*/
18285 /* CLOSE_FILE Include File */
18286 
18287 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h */
18288 /*******************************************************************************
18289  Ports System Service Interface Definition
18290  Company:
18291  Microchip Technology Inc.
18292  File Name:
18293  sys_ports.h
18294  Summary:
18295  Ports System Service interface definitions
18296  Description:
18297  This file contains the interface definition for the Ports system
18298  service. It provides a way to interact with the Ports subsystem to
18299  manage the timing requests supported by the system
18300 *******************************************************************************/
18301 //DOM-IGNORE-BEGIN
18302 /*******************************************************************************
18303 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18304 Microchip licenses to you the right to use, modify, copy and distribute
18305 Software only when embedded on a Microchip microcontroller or digital signal
18306 controller that is integrated into your product or third party product
18307 (pursuant to the sublicense terms in the accompanying license agreement).
18308 You should refer to the license agreement accompanying this Software for
18309 additional information regarding your rights and obligations.
18310 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18311 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18312 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18313 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18314 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18315 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18316 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18317 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18318 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18319 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18320 *******************************************************************************/
18321 //DOM-IGNORE-END
18322 #ifndef _SYS_PORTS_H
18323 #define _SYS_PORTS_H
18324 // *****************************************************************************
18325 // *****************************************************************************
18326 // Section: Included Files
18327 // *****************************************************************************
18328 // *****************************************************************************
18329 /* OPEN FILE C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h */
18330 /*******************************************************************************
18331  PORTS System Service Library Interface Definition
18332  Company:
18333  Microchip Technology Inc.
18334  File Name:
18335  sys_ports_definitions.h
18336  Summary:
18337  PORTS System Service data type definitions header.
18338  Description:
18339  This file contains data type definitions header.
18340 *******************************************************************************/
18341 //DOM-IGNORE-BEGIN
18342 /*******************************************************************************
18343 Copyright (c) 2013-2015 released Microchip Technology Inc. All rights reserved.
18344 Microchip licenses to you the right to use, modify, copy and distribute
18345 Software only when embedded on a Microchip microcontroller or digital signal
18346 controller that is integrated into your product or third party product
18347 (pursuant to the sublicense terms in the accompanying license agreement).
18348 You should refer to the license agreement accompanying this Software for
18349 additional information regarding your rights and obligations.
18350 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18351 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18352 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18353 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18354 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18355 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18356 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18357 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18358 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18359 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18360 *******************************************************************************/
18361 //DOM-IGNORE-END
18362 #ifndef _SYS_PORTS_DEFINITIONS_H
18363 #define _SYS_PORTS_DEFINITIONS_H
18364 // *****************************************************************************
18365 // *****************************************************************************
18366 // Section: File includes
18367 // *****************************************************************************
18368 // *****************************************************************************
18369 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
18370 #include "system/common/sys_common.h"
18371 #include "system/common/sys_module.h"
18372 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h */
18373 /*******************************************************************************
18374  Ports Peripheral Library Interface Header
18375  Company:
18376  Microchip Technology Inc.
18377  File Name:
18378  plib_ports.h
18379  Summary:
18380  Ports Peripheral Library Interface header for Ports function definitions.
18381  Description:
18382  This header file contains the function prototypes and definitions of
18383  the data types and constants that make up the interface to the Ports
18384  Peripheral Library for all families of Microchip microcontrollers. The
18385  definitions in this file are common to the Ports peripheral.
18386 *******************************************************************************/
18387 // DOM-IGNORE-BEGIN
18388 /*******************************************************************************
18389 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
18390 Microchip licenses to you the right to use, modify, copy and distribute
18391 Software only when embedded on a Microchip microcontroller or digital signal
18392 controller that is integrated into your product or third party product
18393 (pursuant to the sublicense terms in the accompanying license agreement).
18394 You should refer to the license agreement accompanying this Software for
18395 additional information regarding your rights and obligations.
18396 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
18397 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18398 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18399 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18400 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18401 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18402 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18403 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18404 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18405 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18406 *******************************************************************************/
18407 // DOM-IGNORE-END
18408 #ifndef _PLIB_PORTS_H
18409 #define _PLIB_PORTS_H
18410 #include <stdint.h>
18411 #include <stddef.h>
18412 // DOM-IGNORE-BEGIN
18413 // DOM-IGNORE-END
18414 // *****************************************************************************
18415 // *****************************************************************************
18416 // Section: Constants & Data Types
18417 // *****************************************************************************
18418 // *****************************************************************************
18419 // *****************************************************************************
18420 /* Ports data mask definition
18421  Summary:
18422  Data type defining the Ports data mask
18423  Description:
18424  This data type defines the Ports data mask
18425  Remarks:
18426  None.
18427 */
18428 
18429 typedef
18430 uint16_t
18432 // *****************************************************************************
18433 /* Ports data type definition
18434  Summary:
18435  Data type defining the Ports data type.
18436  Description:
18437  This data type defines the Ports data type.
18438  Remarks:
18439  None.
18440 */
18441 
18442 typedef
18443 uint32_t
18445 // *****************************************************************************
18446 // *****************************************************************************
18447 // Section: Included Files (continued at end of file)
18448 // *****************************************************************************
18449 // *****************************************************************************
18450 /* This section lists the other files that are included in this file. However,
18451  please see the end of the file for additional implementation header files
18452  that are also included.
18453 */
18454 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h */
18455 //DOM-IGNORE-BEGIN
18456 /*******************************************************************************
18457 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
18458 Microchip licenses to you the right to use, modify, copy and distribute
18459 Software only when embedded on a Microchip microcontroller or digital signal
18460 controller that is integrated into your product or third party product
18461 (pursuant to the sublicense terms in the accompanying license agreement).
18462 You should refer to the license agreement accompanying this Software for
18463 additional information regarding your rights and obligations.
18464 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
18465 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
18466 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
18467 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
18468 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
18469 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
18470 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
18471 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
18472 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
18473 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
18474  *******************************************************************************/
18475 //DOM-IGNORE-END
18476 #ifndef _PLIB_PORTS_PROCESSOR_H
18477 #define _PLIB_PORTS_PROCESSOR_H
18478 #error "Can't find header"
18479 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\processor\ports_processor.h*/
18480 /* CLOSE_FILE Include File */
18481 
18482 // *****************************************************************************
18483 // *****************************************************************************
18484 // Section: Ports Peripheral Library Interface Routines
18485 // *****************************************************************************
18486 // *****************************************************************************
18487 // *****************************************************************************
18488 /* Function:
18489  void PLIB_PORTS_RemapInput( PORTS_MODULE_ID index,
18490  PORTS_REMAP_INPUT_FUNCTION inputFunction,
18491  PORTS_REMAP_INPUT_PIN remapInputPin );
18492  Summary:
18493  Input function remapping.
18494  Description:
18495  This function controls the Input function remapping. It allows user to map
18496  any of the input functionality on any of the remappable input pin.
18497  This function does not perform atomic register access.
18498  Precondition:
18499  IOLOCK bit of configuration register should be clear to allow any remapping.
18500  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18501  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18502  find more information.
18503  Parameters:
18504  index - Identifier for the device instance to be configured
18505  inputFunction - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
18506  remapInputPin - One of the possible values of PORTS_REMAP_INPUT_PIN
18507  Returns:
18508  None.
18509  Example:
18510  <code>
18511 
18512  // System Unlock
18513  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18514  // Unlock PPS registers
18515  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18516  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
18517  PLIB_PORTS_RemapInput(PORTS_ID_0, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
18518  </code>
18519  Remarks:
18520  This feature may not be available on all devices. Please refer to the
18521  specific device data sheet to determine availability or use
18522  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18523  this feature is available.
18524 */
18525 
18526 void
18528  PORTS_MODULE_ID index ,
18529  PORTS_REMAP_INPUT_FUNCTION inputFunction ,
18530  PORTS_REMAP_INPUT_PIN remapInputPin ) ;
18531 // *****************************************************************************
18532 /* Function:
18533  void PLIB_PORTS_RemapOutput( PORTS_MODULE_ID index,
18534  PORTS_REMAP_OUTPUT_FUNCTION outputFunction,
18535  PORTS_REMAP_OUTPUT_PIN remapOutputPin );
18536  Summary:
18537  Output function remapping.
18538  Description:
18539  This function controls the Output function remapping. it allows user to map
18540  any of the output functionality on any of the remappable output pin.
18541  This function does not perform atomic register access.
18542  Precondition:
18543  IOLOCK bit of configuration register should be clear to allow any remapping.
18544  PLIB_DEVCON_DeviceRegistersUnlock function can be used for that purpose.
18545  Refer DEVCON PLIB (or System Service) and the specific device data sheet to
18546  find more information.
18547  Parameters:
18548  index - Identifier for the device instance to be configured
18549  outputFunction - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
18550  remapOutputPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
18551  Returns:
18552  None.
18553  Example:
18554  <code>
18555 
18556  // System Unlock
18557  PLIB_DEVCON_SystemUnlock(DEVCON_ID_0);
18558  // Unlock PPS registers
18559  PLIB_DEVCON_DeviceRegistersUnlock(DEVCON_ID_0, DEVCON_PPS_REGISTERS);
18560  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
18561  PLIB_PORTS_RemapOutput(PORTS_ID_0, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
18562 
18563  </code>
18564  Remarks:
18565  This feature may not be available on all devices. Please refer to the
18566  specific device data sheet to determine availability or use
18567  PLIB_PORTS_ExistsRemapInputOutput in your application to determine whether
18568  this feature is available.
18569 */
18570 
18571 void
18573  PORTS_MODULE_ID index ,
18574  PORTS_REMAP_OUTPUT_FUNCTION outputFunction ,
18575  PORTS_REMAP_OUTPUT_PIN remapOutputPin ) ;
18576 // *****************************************************************************
18577 /* Function:
18578  void PLIB_PORTS_PinModeSelect( PORTS_MODULE_ID index,
18579  PORTS_ANALOG_PIN pin,
18580  PORTS_PIN_MODE mode );
18581  Summary:
18582  Enables the selected pin as analog or digital.
18583  Description:
18584  This function enables the selected pin as analog or digital.
18585  This function does not perform atomic register access.
18586  Precondition:
18587  None.
18588  Parameters:
18589  index - Identifier for the device instance to be configured
18590  pin - Possible values of PORTS_ANALOG_PIN
18591  mode - Possible values of PORTS_PIN_MODE
18592  Returns:
18593  None.
18594  Example:
18595  <code>
18596 
18597  // Make AN0 pin as Analog
18598  PLIB_PORTS_PinModeSelect(PORTS_ID_0, PORTS_ANALOG_PIN_0, PORTS_PIN_MODE_ANALOG);
18599 
18600  </code>
18601  Remarks:
18602  This feature may not be available on all devices. Please refer to the
18603  specific device data sheet to determine availability or use
18604  PLIB_PORTS_ExistsPinMode in your application to determine whether
18605  this feature is available.
18606 */
18607 
18608 void
18610  PORTS_MODULE_ID index ,
18611  PORTS_ANALOG_PIN pin ,
18612  PORTS_PIN_MODE mode ) ;
18613 // *****************************************************************************
18614 /* Function:
18615  void PLIB_PORTS_PinModePerPortSelect( PORTS_MODULE_ID index,
18616  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos,
18617  PORTS_PIN_MODE mode );
18618  Summary:
18619  Enables the selected port pin as analog or digital.
18620  Description:
18621  This function enables the selected port pin as analog or digital.
18622  This function does not perform atomic register access.
18623  Precondition:
18624  None.
18625  Parameters:
18626  index - Identifier for the device instance to be configured
18627  channel - Port pin channel
18628  bitPos - Position in the PORT pins
18629  mode - Possible values of PORTS_PIN_MODE
18630  Returns:
18631  None.
18632  Example:
18633  <code>
18634 
18635  // Make RC5 pin Analog
18636  PLIB_PORTS_PinModePerPortSelect(PORTS_ID_0, PORT_CHANNEL_C,
18637  PORTS_BIT_POS_5, PORTS_PIN_MODE_ANALOG);
18638 
18639  </code>
18640  Remarks:
18641  This function is only available in devices with PPS. For Non-PPS devices, use the
18642  PLIB_PORTS_PinModeSelect function.
18643 
18644  This feature may not be available on all devices. Please refer to the
18645  specific device data sheet to determine availability or use
18646  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
18647  this feature is available.
18648 */
18649 
18650 void
18652  PORTS_MODULE_ID index ,
18653  PORTS_CHANNEL channel ,
18654  PORTS_BIT_POS bitPos ,
18655  PORTS_PIN_MODE mode ) ;
18656 // *****************************************************************************
18657 /* Function:
18658  void PLIB_PORTS_ChangeNoticePullDownPerPortEnable( PORTS_MODULE_ID index,
18659  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18660  Summary:
18661  Enables the pull-down for selected Change Notice pins.
18662  Description:
18663  This function enables the pull-down for selected Change Notice pins.
18664  This function does not perform atomic register access.
18665  Precondition:
18666  None.
18667  Parameters:
18668  index - Identifier for the device instance to be configured
18669  channel - Port pin channel
18670  bitPos - Position in the PORT pins
18671  Returns:
18672  None.
18673  Example:
18674  <code>
18675 
18676  // Enable pull-down for RC5 pin
18677  PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18678  PORTS_BIT_POS_5);
18679 
18680  </code>
18681  Remarks:
18682  This feature may not be available on all devices. Please refer to the
18683  specific device data sheet to determine availability or use
18684  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18685  determine whether this feature is available.
18686 */
18687 
18688 void
18690  PORTS_MODULE_ID index ,
18691  PORTS_CHANNEL channel ,
18692  PORTS_BIT_POS bitPos ) ;
18693 // *****************************************************************************
18694 /* Function:
18695  void PLIB_PORTS_ChangeNoticePullDownPerPortDisable( PORTS_MODULE_ID index,
18696  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18697  Summary:
18698  Disables the pull-down for selected Change Notice pins.
18699  Description:
18700  This function disables the pull-down for selected Change Notice pins.
18701  This function does not perform atomic register access.
18702  Precondition:
18703  None.
18704  Parameters:
18705  index - Identifier for the device instance to be configured
18706  channel - Port pin channel
18707  bitPos - Position in the PORT pins
18708  Returns:
18709  None.
18710  Example:
18711  <code>
18712 
18713  // Disable pull-down for RC5 pin
18714  PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18715  PORTS_BIT_POS_5);
18716  </code>
18717  Remarks:
18718  This feature may not be available on all devices. Please refer to the
18719  specific device data sheet to determine availability or use
18720  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
18721  determine whether this feature is available.
18722 */
18723 
18724 void
18726  PORTS_MODULE_ID index ,
18727  PORTS_CHANNEL channel ,
18728  PORTS_BIT_POS bitPos ) ;
18729 // *****************************************************************************
18730 /* Function:
18731  void PLIB_PORTS_ChangeNoticePullUpPerPortEnable ( PORTS_MODULE_ID index,
18732  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18733  Summary:
18734  Enables the pull-up for selected Change Notice pins.
18735  Description:
18736  This function enables the pull-up for selected Change Notice pins.
18737  This function does not perform atomic register access.
18738  Precondition:
18739  None.
18740  Parameters:
18741  index - Identifier for the device instance to be configured
18742  channel - Port pin channel
18743  bitPos - Position in the PORT pins
18744  Returns:
18745  None.
18746  Example:
18747  <code>
18748 
18749  // Enable pull-up for RC5 pin
18750  PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18751  PORTS_BIT_POS_5);
18752  </code>
18753  Remarks:
18754  This function is only available in devices with PPS. For Non-PPS devices, use the
18755  PLIB_PORTS_ChangeNoticePullUpEnable function.
18756 
18757  This feature may not be available on all devices. Please refer to the
18758  specific device data sheet to determine availability or use
18759  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18760  determine whether this feature is available.
18761 */
18762 
18763 void
18765  PORTS_MODULE_ID index ,
18766  PORTS_CHANNEL channel ,
18767  PORTS_BIT_POS bitPos ) ;
18768 // *****************************************************************************
18769 /* Function:
18770  void PLIB_PORTS_ChangeNoticePullUpPerPortDisable( PORTS_MODULE_ID index,
18771  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
18772  Summary:
18773  Disables weak pull-up for the selected pin.
18774  Description:
18775  This function disables weak pull-up for the selected port pin.
18776  This function does not perform atomic register access.
18777  Precondition:
18778  None.
18779  Parameters:
18780  index - Identifier for the device instance to be configured
18781  channel - Port pin channel
18782  bitPos - Position in the PORT pins
18783  Returns:
18784  None.
18785  Example:
18786  <code>
18787 
18788  // Disable pull-up for RC5 pin
18789  PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18790  PORTS_BIT_POS_5);
18791 
18792  </code>
18793  Remarks:
18794  This function is only available in devices with PPS. For Non-PPS devices, use the
18795  PLIB_PORTS_ChangeNoticePullUpDisable function.
18796 
18797  Pull-ups on change notification pins should always be disabled when the
18798  port pin is configured as a digital output.
18799 
18800  This feature may not be available on all devices. Please refer to the
18801  specific device data sheet to determine availability or use
18802  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
18803  determine whether this feature is available.
18804 */
18805 
18806 void
18808  PORTS_MODULE_ID index ,
18809  PORTS_CHANNEL channel ,
18810  PORTS_BIT_POS bitPos ) ;
18811 // *****************************************************************************
18812 /* Function:
18813  void PLIB_PORTS_PinChangeNoticePerPortEnable ( PORTS_MODULE_ID index,
18814  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18815  Summary:
18816  Enables CN interrupt for the selected pin.
18817  Description:
18818  This function enables Change Notice interrupt for the selected port pin.
18819  This function does not perform atomic register access.
18820 
18821  Precondition:
18822  None.
18823  Parameters:
18824  index - Identifier for the device instance to be configured
18825  channel - Port pin channel
18826  bitPos - Position in the PORT pins
18827  Returns:
18828  None.
18829  Example:
18830  <code>
18831 
18832  // Enable CN interrupt for RC5 pin
18833  PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C,
18834  PORTS_BIT_POS_5);
18835 
18836  </code>
18837  Remarks:
18838  This function is only available in devices with PPS. For Non-PPS devices, use the
18839  PLIB_PORTS_PinChangeNoticeEnable function.
18840 
18841  This feature may not be available on all devices. Please refer to the
18842  specific device data sheet to determine availability or use
18843  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18844  determine whether this feature is available.
18845 */
18846 
18847 void
18849  PORTS_MODULE_ID index ,
18850  PORTS_CHANNEL channel ,
18851  PORTS_BIT_POS bitPos ) ;
18852 // *****************************************************************************
18853 /* Function:
18854  void PLIB_PORTS_PinChangeNoticePerPortDisable( PORTS_MODULE_ID index,
18855  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos )
18856  Summary:
18857  Disables CN interrupt for the selected pin.
18858  Description:
18859  This function disables Change Notice interrupt for the selected port pin.
18860  This function does not perform atomic register access.
18861  Precondition:
18862  None.
18863  Parameters:
18864  index - Identifier for the device instance to be configured
18865  channel - Port pin channel
18866  bitPos - Position in the PORT pins
18867  Returns:
18868  None.
18869  Example:
18870  <code>
18871 
18872  // Disable CN interrupt for RC5 pin
18873  PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C,
18874  PORTS_BIT_POS_5);
18875 
18876  </code>
18877  Remarks:
18878  This function is only available in devices with PPS. For Non-PPS devices, use the
18879  PLIB_PORTS_PinChangeNoticeDisable function.
18880 
18881  This feature may not be available on all devices. Please refer to the
18882  specific device data sheet to determine availability or use
18883  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
18884  determine whether this feature is available.
18885 */
18886 
18887 void
18889  PORTS_MODULE_ID index ,
18890  PORTS_CHANNEL channel ,
18891  PORTS_BIT_POS bitPos ) ;
18892 // *****************************************************************************
18893 /* Function:
18894  void PLIB_PORTS_ChangeNoticePerPortTurnOn ( PORTS_MODULE_ID index,
18895  PORTS_CHANNEL channel );
18896  Summary:
18897  Enables the change notification for selected port.
18898  Description:
18899  This function enables the change notification for selected port.
18900  This function does not perform atomic register access.
18901  Precondition:
18902  None.
18903  Parameters:
18904  index - Identifier for the device instance to be configured
18905  channel - Port pin channel
18906  Returns:
18907  None.
18908  Example:
18909  <code>
18910  // Enable Change notification for Port C
18911  PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_ID_0, PORT_CHANNEL_C);
18912 
18913  </code>
18914  Remarks:
18915  This function is only available in devices with PPS. For Non-PPS devices, use the
18916  PLIB_PORTS_ChangeNoticeEnable function.
18917 
18918  This feature may not be available on all devices. Please refer to the
18919  specific device data sheet to determine availability or use
18920  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18921  whether this feature is available.
18922 */
18923 
18924 void
18926  PORTS_MODULE_ID index ,
18927  PORTS_CHANNEL channel ) ;
18928 // *****************************************************************************
18929 /* Function:
18930  void PLIB_PORTS_ChangeNoticePerPortTurnOff( PORTS_MODULE_ID index,
18931  PORTS_CHANNEL channel );
18932  Summary:
18933  Disables the change notification for selected port.
18934  Description:
18935  This function disables the change notification for selected port.
18936  This function does not perform atomic register access.
18937  Precondition:
18938  None.
18939  Parameters:
18940  index - Identifier for the device instance to be configured
18941  channel - Port pin channel
18942  Returns:
18943  None.
18944  Example:
18945  <code>
18946  // Disable Change notification for Port C
18947  PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_ID_0, PORT_CHANNEL_C);
18948 
18949  </code>
18950  Remarks:
18951  This function is only available in devices with PPS. For Non-PPS devices, use the
18952  PLIB_PORTS_ChangeNoticeDisable function.
18953 
18954  This feature may not be available on all devices. Please refer to the
18955  specific device data sheet to determine availability or use
18956  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn in your application to determine
18957  whether this feature is available.
18958 */
18959 
18960 void
18962  PORTS_MODULE_ID index ,
18963  PORTS_CHANNEL channel ) ;
18964 // *****************************************************************************
18965 /* Function:
18966  void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable ( PORTS_MODULE_ID index,
18967  PORTS_CHANNEL channel );
18968  Summary:
18969  Allows CN to be working in Idle mode for selected channel.
18970  Description:
18971  This function makes sure that change notification feature keeps working in
18972  Idle mode for the selected channel.
18973  This function does not perform atomic register access.
18974  Precondition:
18975  None.
18976  Parameters:
18977  index - Identifier for the device instance to be configured
18978  channel - Port pin channel
18979  Returns:
18980  None.
18981  Example:
18982  <code>
18983 
18984  // Change notification continues working in Idle mode for Port C
18985  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_ID_0, PORT_CHANNEL_C);
18986 
18987  </code>
18988  Remarks:
18989  This function is only available in devices with PPS. For Non-PPS devices, use the
18990  PLIB_PORTS_ChangeNoticeInIdleEnable function.
18991 
18992  This feature may not be available on all devices. Please refer to the
18993  specific device data sheet to determine availability or use
18994  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
18995  whether this feature is available.
18996 */
18997 
18998 void
19000  PORTS_MODULE_ID index ,
19001  PORTS_CHANNEL channel ) ;
19002 // *****************************************************************************
19003 /* Function:
19004  void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable( PORTS_MODULE_ID index,
19005  PORTS_CHANNEL channel );
19006  Summary:
19007  Change Notification halts in Idle mode for selected channel.
19008  Description:
19009  This function makes sure that change notification feature halts in
19010  Idle mode for the selected channel.
19011  This function does not perform atomic register access.
19012  Precondition:
19013  None.
19014  Parameters:
19015  index - Identifier for the device instance to be configured
19016  channel - Port pin channel
19017  Returns:
19018  None.
19019  Example:
19020  <code>
19021 
19022  // Change notification halts in Idle mode for Port C
19023  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_ID_0, PORT_CHANNEL_C);
19024 
19025  </code>
19026  Remarks:
19027  This function is only available in devices with PPS. For Non-PPS devices, use the
19028  PLIB_PORTS_ChangeNoticeInIdleDisable function.
19029 
19030  This feature may not be available on all devices. Please refer to the
19031  specific device data sheet to determine availability or use
19032  PLIB_PORTS_ExistsChangeNoticePerPortInIdle in your application to determine
19033  whether this feature is available.
19034 */
19035 
19036 void
19038  PORTS_MODULE_ID index ,
19039  PORTS_CHANNEL channel ) ;
19040 // *****************************************************************************
19041 /* Function:
19042  bool PLIB_PORTS_ChangeNoticePerPortHasOccurred ( PORTS_MODULE_ID index,
19043  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
19044  Summary:
19045  checks the status of change on the pin
19046  Description:
19047  This function checks if the change has occurred on the given pin or not.
19048  This function does not perform atomic register access.
19049  Precondition:
19050  None.
19051  Parameters:
19052  index - Identifier for the device instance to be configured
19053  channel - Port pin channel
19054  bitPos - Position in the PORT pins
19055  Returns:
19056  None.
19057  Example:
19058  <code>
19059 
19060  if(PLIB_PORTS_ChangeNoticePerPortHasOccurred( PORTS_ID_0,
19061  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
19062  {
19063  //do something
19064  }
19065 
19066  </code>
19067  Remarks:
19068  This feature may not be available on all devices. Please refer to the
19069  specific device data sheet to determine availability or use
19070  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
19071  whether this feature is available.
19072 */
19073 
19074 bool
19076  PORTS_MODULE_ID index ,
19077  PORTS_CHANNEL channel ,
19078  PORTS_BIT_POS bitPos ) ;
19079 // *****************************************************************************
19080 /* Function:
19081  bool PLIB_PORTS_PinGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19082  PORTS_BIT_POS bitPos )
19083  Summary:
19084  Reads/Gets data from the selected digital pin.
19085  Description:
19086  This function reads/gets data from the selected digital PORT i/o pin.
19087  This function should be used to read the live data at the pin.
19088  This function does not perform atomic register access.
19089 
19090  Precondition:
19091  None.
19092  Parameters:
19093  index - Identifier for the device instance to be configured
19094  channel - Identifier for the Ports channel A, B, C, etc.
19095  bitPos - Possible values of PORTS_BIT_POS
19096  Returns:
19097  Port pin read data.
19098  Example:
19099  <code>
19100  // read port pin RC4
19101  bool bitStatus = PLIB_PORTS_PinGet(PORTS_ID_0, PORT_CHANNEL_C,
19102  PORTS_BIT_POS_4);
19103  </code>
19104  Remarks:
19105  For reading the Latched data, PLIB_PORTS_PinGetLatched function should be used.
19106 
19107  This feature may not be available on all devices. Please refer to the
19108  specific device data sheet to determine availability or use
19109  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19110  this feature is available.
19111 */
19112 
19113 bool
19115  PORTS_MODULE_ID index ,
19116  PORTS_CHANNEL channel ,
19117  PORTS_BIT_POS bitPos ) ;
19118 // *****************************************************************************
19119 /* Function:
19120  bool PLIB_PORTS_PinGetLatched( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19121  PORTS_BIT_POS bitPos )
19122  Summary:
19123  Reads/Gets data from the selected latch.
19124  Description:
19125  This function reads/gets data from the selected PORTx Data Latch, not from
19126  the port I/O pins.
19127  This function does not perform atomic register access.
19128 
19129  Precondition:
19130  None.
19131  Parameters:
19132  index - Identifier for the device instance to be configured
19133  channel - Identifier for the Ports channel A, B, C, etc.
19134  bitPos - Possible values of PORTS_BIT_POS
19135  Returns:
19136  Latch read data.
19137  Example:
19138  <code>
19139  // read latch RC4
19140  bool bitStatus = PLIB_PORTS_PinGetLatched(PORTS_ID_0, PORT_CHANNEL_C,
19141  PORTS_BIT_POS_4);
19142  </code>
19143  Remarks:
19144  For reading the Live data from the i/o pin, PLIB_PORTS_PinGet function
19145  should be used.
19146 
19147  This feature may not be available on all devices. Please refer to the
19148  specific device data sheet to determine availability or use
19149  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19150  this feature is available.
19151 */
19152 
19153 bool
19155  PORTS_MODULE_ID index ,
19156  PORTS_CHANNEL channel ,
19157  PORTS_BIT_POS bitPos ) ;
19158 // *****************************************************************************
19159 /* Function:
19160  void PLIB_PORTS_PinWrite( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19161  PORTS_BIT_POS bitPos,
19162  bool value )
19163  Summary:
19164  Writes the selected digital pin/latch.
19165  Description:
19166  This function writes to the selected digital pin/latch.
19167  This function does not perform atomic register access.
19168  Precondition:
19169  None.
19170  Parameters:
19171  index - Identifier for the device instance to be configured
19172  channel - Identifier for the Ports channel A, B, C, etc.
19173  bitPos - Possible values of PORTS_BIT_POS
19174  value - Value to be written to the specific pin/latch
19175  true - sets the bit, false - clears the bit
19176  Returns:
19177  None.
19178  Example:
19179  <code>
19180 
19181  // write 'one' in port RC4
19182  PLIB_PORTS_PinWrite(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4, 1);
19183 
19184  </code>
19185  Remarks:
19186  This feature may not be available on all devices. Please refer to the
19187  specific device data sheet to determine availability or use
19188  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19189  this feature is available.
19190 */
19191 
19192 void
19194  PORTS_MODULE_ID index ,
19195  PORTS_CHANNEL channel ,
19196  PORTS_BIT_POS bitPos ,
19197  bool value ) ;
19198 // *****************************************************************************
19199 /* Function:
19200  void PLIB_PORTS_PinSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19201  PORTS_BIT_POS bitPos )
19202  Summary:
19203  Sets the selected digital pin/latch.
19204  Description:
19205  This function sets the selected digital pin/latch.
19206  This function does not perform atomic register access.
19207  Precondition:
19208  None.
19209  Parameters:
19210  index - Identifier for the device instance to be configured
19211  channel - Identifier for the Ports channel A, B, C, etc.
19212  bitPos - Possible values of PORTS_BIT_POS
19213  Returns:
19214  None.
19215  Example:
19216  <code>
19217 
19218  // Sets port pin RC4
19219  PLIB_PORTS_PinSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19220 
19221  </code>
19222  Remarks:
19223  This feature may not be available on all devices. Please refer to the
19224  specific device data sheet to determine availability or use
19225  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19226  this feature is available.
19227 */
19228 
19229 void
19231  PORTS_MODULE_ID index ,
19232  PORTS_CHANNEL channel ,
19233  PORTS_BIT_POS bitPos ) ;
19234 // *****************************************************************************
19235 /* Function:
19236  void PLIB_PORTS_PinClear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19237  PORTS_BIT_POS bitPos )
19238  Summary:
19239  Clears the selected digital pin/latch.
19240  Description:
19241  This function clears the selected digital pin/latch.
19242  This function does not perform atomic register access.
19243  Precondition:
19244  None.
19245  Parameters:
19246  index - Identifier for the device instance to be configured
19247  channel - Identifier for the Ports channel A, B, C, etc.
19248  bitPos - Possible values of PORTS_BIT_POS
19249  Returns:
19250  None.
19251  Example:
19252  <code>
19253 
19254  // Clears port pin RC4
19255  PLIB_PORTS_PinClear(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19256 
19257  </code>
19258  Remarks:
19259  This feature may not be available on all devices. Please refer to the
19260  specific device data sheet to determine availability or use
19261  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19262  this feature is available.
19263 */
19264 
19265 void
19267  PORTS_MODULE_ID index ,
19268  PORTS_CHANNEL channel ,
19269  PORTS_BIT_POS bitPos ) ;
19270 // *****************************************************************************
19271 /* Function:
19272  void PLIB_PORTS_PinToggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19273  PORTS_BIT_POS bitPos )
19274  Summary:
19275  Toggles the selected digital pin/latch.
19276  Description:
19277  This function toggles the selected digital pin/latch.
19278  This function does not perform atomic register access.
19279  Precondition:
19280  None.
19281  Parameters:
19282  index - Identifier for the device instance to be configured
19283  channel - Identifier for the Ports channel A, B, C, etc.
19284  bitPos - Possible values of PORTS_BIT_POS
19285  Returns:
19286  None.
19287  Example:
19288  <code>
19289 
19290  // Toggles port pin RC4
19291  PLIB_PORTS_PinToggle(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19292 
19293  </code>
19294  Remarks:
19295  This feature may not be available on all devices. Please refer to the
19296  specific device data sheet to determine availability or use
19297  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19298  this feature is available.
19299 */
19300 
19301 void
19303  PORTS_MODULE_ID index ,
19304  PORTS_CHANNEL channel ,
19305  PORTS_BIT_POS bitPos ) ;
19306 // *****************************************************************************
19307 /* Function:
19308  void PLIB_PORTS_PinDirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19309  PORTS_BIT_POS bitPos )
19310  Summary:
19311  Makes the selected pin direction input
19312  Description:
19313  This function makes the selected pin direction as input
19314  This function does not perform atomic register access.
19315  Precondition:
19316  None.
19317  Parameters:
19318  index - Identifier for the device instance to be configured
19319  channel - Identifier for the Ports channel A, B, C, etc.
19320  bitPos - Possible values of PORTS_BIT_POS direction that has to
19321  be made input
19322  Returns:
19323  None.
19324  Example:
19325  <code>
19326 
19327  // make pin RC4 as input
19328  PLIB_PORTS_PinDirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19329 
19330  </code>
19331  Remarks:
19332  This feature may not be available on all devices. Please refer to the
19333  specific device data sheet to determine availability or use
19334  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19335  this feature is available.
19336 */
19337 
19338 void
19340  PORTS_MODULE_ID index ,
19341  PORTS_CHANNEL channel ,
19342  PORTS_BIT_POS bitPos ) ;
19343 // *****************************************************************************
19344 /* Function:
19345  void PLIB_PORTS_PinDirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19346  PORTS_BIT_POS bitPos )
19347  Summary:
19348  Makes the selected pin direction output
19349  Description:
19350  This function makes the selected pin direction as output
19351  This function does not perform atomic register access.
19352  Precondition:
19353  None.
19354  Parameters:
19355  index - Identifier for the device instance to be configured
19356  channel - Identifier for the Ports channel A, B, C, etc.
19357  bitPos - Possible values of PORTS_BIT_POS direction that has to
19358  be made output
19359  Returns:
19360  None.
19361  Example:
19362  <code>
19363 
19364  // make pin RC4 as output
19365  PLIB_PORTS_PinDirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19366 
19367  </code>
19368  Remarks:
19369  This feature may not be available on all devices. Please refer to the
19370  specific device data sheet to determine availability or use
19371  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19372  this feature is available.
19373 */
19374 
19375 void
19377  PORTS_MODULE_ID index ,
19378  PORTS_CHANNEL channel ,
19379  PORTS_BIT_POS bitPos ) ;
19380 // *****************************************************************************
19381 /* Function:
19382  void PLIB_PORTS_PinOpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19383  PORTS_BIT_POS bitPos )
19384  Summary:
19385  Enables the open drain functionality for the selected pin.
19386  Description:
19387  This function enables the open drain functionality for the selected pin.
19388  This function does not perform atomic register access.
19389  Precondition:
19390  None.
19391  Parameters:
19392  index - Identifier for the device instance to be configured
19393  channel - Identifier for the Ports channel A, B, C, etc.
19394  bitPos - Possible values of PORTS_BIT_POS
19395  Returns:
19396  None.
19397  Example:
19398  <code>
19399 
19400  // Enable open drain for pin RC4
19401  PLIB_PORTS_PinOpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19402 
19403  </code>
19404  Remarks:
19405  This feature may not be available on all devices. Please refer to the
19406  specific device data sheet to determine availability or use
19407  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19408  this feature is available.
19409 */
19410 
19411 void
19413  PORTS_MODULE_ID index ,
19414  PORTS_CHANNEL channel ,
19415  PORTS_BIT_POS bitPos ) ;
19416 // *****************************************************************************
19417 /* Function:
19418  void PLIB_PORTS_PinOpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19419  PORTS_BIT_POS bitPos )
19420  Summary:
19421  Disables the open drain functionality for the selected pin.
19422  Description:
19423  This function disables the open drain functionality for the selected pin.
19424  This function does not perform atomic register access.
19425  Precondition:
19426  None.
19427  Parameters:
19428  index - Identifier for the device instance to be configured
19429  channel - Identifier for the Ports channel A, B, C, etc.
19430  bitPos - One of the possible values of PORTS_BIT_POS.
19431  Returns:
19432  None.
19433  Example:
19434  <code>
19435 
19436  // Disable open drain for pin RC4
19437  PLIB_PORTS_PinOpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_4);
19438 
19439  </code>
19440  Remarks:
19441  This feature may not be available on all devices. Please refer to the
19442  specific device data sheet to determine availability or use
19443  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19444  this feature is available.
19445 */
19446 
19447 void
19449  PORTS_MODULE_ID index ,
19450  PORTS_CHANNEL channel ,
19451  PORTS_BIT_POS bitPos ) ;
19452 // *****************************************************************************
19453 /* Function:
19454  PORTS_DATA_TYPE PLIB_PORTS_ReadLatched
19455  (
19456  PORTS_MODULE_ID index,
19457  PORTS_CHANNEL channel
19458  )
19459  Summary:
19460  Reads and returns data from the selected Latch.
19461  Description:
19462  This function reads and returns the data from the selected Latch.
19463  This function does not perform atomic register access.
19464 
19465  Precondition:
19466  None.
19467  Parameters:
19468  index - Identifier for the device instance to be configured
19469  channel - Identifier for the Ports channel A, B, C, etc.
19470  Returns:
19471  Latch read data.
19472  Example:
19473  <code>
19474  // Read latch C
19475  PORTS_DATA_TYPE bitStatus = PLIB_PORTS_ReadLatched(PORTS_ID_0, PORT_CHANNEL_C);
19476 
19477  </code>
19478  Remarks:
19479  For reading the Live data, PLIB_PORTS_Read function should be used.
19480 
19481  This feature may not be available on all devices. Please refer to the
19482  specific device data sheet to determine availability or use
19483  PLIB_PORTS_ExistsLatchRead in your application to determine whether
19484  this feature is available.
19485 */
19486 
19489  PORTS_MODULE_ID index ,
19490  PORTS_CHANNEL channel ) ;
19491 // *****************************************************************************
19492 /* Function:
19493  PORTS_DATA_TYPE PLIB_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19494  Summary:
19495  Reads the selected digital port.
19496  Description:
19497  This function reads from the selected digital port.
19498  This function does not perform atomic register access.
19499  Precondition:
19500  None.
19501  Parameters:
19502  index - Identifier for the device instance to be configured
19503  channel - Identifier for the Ports channel A, B, C, etc.
19504  Returns:
19505  data on a port with width PORTS_DATA_TYPE
19506  Example:
19507  <code>
19508 
19509  // Read PORT C
19510  PORTS_DATA_TYPE readData = PLIB_PORTS_Read(PORTS_ID_0, PORT_CHANNEL_C);
19511 
19512  </code>
19513  Remarks:
19514  For reading the Latched data, PLIB_PORTS_ReadLatched function should be used.
19515 
19516  This feature may not be available on all devices. Please refer to the
19517  specific device data sheet to determine availability or use
19518  PLIB_PORTS_ExistsPortsRead in your application to determine whether
19519  this feature is available.
19520 */
19521 
19523  PLIB_PORTS_Read (
19524  PORTS_MODULE_ID index ,
19525  PORTS_CHANNEL channel ) ;
19526 // *****************************************************************************
19527 /* Function:
19528  void PLIB_PORTS_Write( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19529  PORTS_DATA_TYPE value )
19530  Summary:
19531  Writes the selected digital port/latch.
19532  Description:
19533  This function writes to the selected digital port/latch.
19534  This function does not perform atomic register access.
19535  Precondition:
19536  None.
19537  Parameters:
19538  index - Identifier for the device instance to be configured
19539  channel - Identifier for the Ports channel A, B, C, etc.
19540  value - Value to be written into a port of width PORTS_DATA_TYPE
19541  Returns:
19542  None.
19543  Example:
19544  <code>
19545 
19546  // Write 0x12 into PORT C
19547  PLIB_PORTS_Write(PORTS_ID_0, PORT_CHANNEL_C, 0x12);
19548 
19549  </code>
19550  Remarks:
19551  This feature may not be available on all devices. Please refer to the
19552  specific device data sheet to determine availability or use
19553  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19554  this feature is available.
19555 */
19556 
19557 void
19559  PORTS_MODULE_ID index ,
19560  PORTS_CHANNEL channel ,
19561  PORTS_DATA_TYPE value ) ;
19562 // *****************************************************************************
19563 /* Function:
19564  void PLIB_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19565  PORTS_DATA_TYPE value,
19566  PORTS_DATA_MASK mask )
19567  Summary:
19568  Sets the selected bits of the port.
19569  Description:
19570  This function performs an 'AND' operation on the value and mask parameters,
19571  and then sets the bits in the port channel that were set by the result of the
19572  'AND' operation.
19573  This function does not perform atomic register access.
19574  Precondition:
19575  None.
19576  Parameters:
19577  index - Identifier for the device instance to be configured
19578  channel - Identifier for the Ports channel A, B, C, etc.
19579  value - Consists of information about which port bit has to be
19580  set and which not
19581  mask - Identifies the bits which could be intended for setting
19582  Returns:
19583  None.
19584  Example:
19585  <code>
19586 
19587  // MY_VALUE - 0x1234
19588  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
19589 
19590  // Set the PORT C bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
19591  PLIB_PORTS_Set(MY_PORTS_INSTANCE, PORT_CHANNEL_C, MY_VALUE, myMask);
19592 
19593  </code>
19594  Remarks:
19595  This feature may not be available on all devices. Please refer to the
19596  specific device data sheet to determine availability or use
19597  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19598  this feature is available.
19599 */
19600 
19601 void
19602  PLIB_PORTS_Set (
19603  PORTS_MODULE_ID index ,
19604  PORTS_CHANNEL channel ,
19605  PORTS_DATA_TYPE value ,
19606  PORTS_DATA_MASK mask ) ;
19607 // *****************************************************************************
19608 /* Function:
19609  void PLIB_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19610  PORTS_DATA_MASK toggleMask )
19611  Summary:
19612  Toggles the selected digital port/latch.
19613  Description:
19614  This function toggles the selected digital port/latch.
19615  This function does not perform atomic register access.
19616  Precondition:
19617  None.
19618  Parameters:
19619  index - Identifier for the device instance to be configured
19620  channel - Identifier for the Ports channel A, B, C, etc.
19621  toggleMask - Identifies the bits to be toggled
19622  Returns:
19623  None.
19624  Example:
19625  <code>
19626 
19627  // Toggles the three least significant Port C bits
19628  PLIB_PORTS_Toggle(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19629 
19630  </code>
19631  Remarks:
19632  This feature may not be available on all devices. Please refer to the
19633  specific device data sheet to determine availability or use
19634  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19635  this feature is available.
19636 */
19637 
19638 void
19640  PORTS_MODULE_ID index ,
19641  PORTS_CHANNEL channel ,
19642  PORTS_DATA_MASK toggleMask ) ;
19643 // *****************************************************************************
19644 /* Function:
19645  void PLIB_PORTS_Clear( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19646  PORTS_DATA_MASK clearMask )
19647  Summary:
19648  Clears the selected digital port/latch bits.
19649  Description:
19650  This function clears the selected digital port/latch bits.
19651  This function does not perform atomic register access.
19652  Precondition:
19653  None.
19654  Parameters:
19655  index - Identifier for the device instance to be configured
19656  channel - Identifier for the Ports channel A, B, C, etc.
19657  clearMask - Identifies the bits to be cleared
19658  Returns:
19659  None.
19660  Example:
19661  <code>
19662 
19663  // Clears the three least significant Port C bits
19664  PLIB_PORTS_Clear(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19665 
19666  </code>
19667  Remarks:
19668  This feature may not be available on all devices. Please refer to the
19669  specific device data sheet to determine availability or use
19670  PLIB_PORTS_ExistsPortsWrite in your application to determine whether
19671  this feature is available.
19672 */
19673 
19674 void
19676  PORTS_MODULE_ID index ,
19677  PORTS_CHANNEL channel ,
19678  PORTS_DATA_MASK clearMask ) ;
19679 // *****************************************************************************
19680 /* Function:
19681  void PLIB_PORTS_DirectionInputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19682  PORTS_DATA_MASK mask )
19683  Summary:
19684  Makes the selected pins direction input.
19685  Description:
19686  This function makes the selected pins direction input.
19687  This function does not perform atomic register access.
19688 
19689  Precondition:
19690  None.
19691  Parameters:
19692  index - Identifier for the device instance to be configured
19693  channel - Identifier for the Ports channel A, B, C, etc.
19694  mask - Identifies the pins direction that has to be made input
19695  Returns:
19696  None.
19697  Example:
19698  <code>
19699 
19700  // Make RC0, RC1 and RC2 pins as Input
19701  PLIB_PORTS_DirectionInputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19702 
19703  </code>
19704  Remarks:
19705  This feature may not be available on all devices. Please refer to the
19706  specific device data sheet to determine availability or use
19707  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19708  this feature is available.
19709 */
19710 
19711 void
19713  PORTS_MODULE_ID index ,
19714  PORTS_CHANNEL channel ,
19715  PORTS_DATA_MASK mask ) ;
19716 // *****************************************************************************
19717 /* Function:
19718  void PLIB_PORTS_DirectionOutputSet( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19719  PORTS_DATA_MASK mask )
19720  Summary:
19721  Makes the selected pins direction output.
19722  Description:
19723  This function makes the selected pins direction output.
19724  This function does not perform atomic register access.
19725  Precondition:
19726  None.
19727  Parameters:
19728  index - Identifier for the device instance to be configured
19729  channel - Identifier for the Ports channel A, B, C, etc.
19730  mask - Identifies the pins direction that has to be made output
19731  Returns:
19732  None.
19733  Example:
19734  <code>
19735 
19736  // Make RC0, RC1 and RC2 pins as Output
19737  PLIB_PORTS_DirectionOutputSet(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19738 
19739  </code>
19740  Remarks:
19741  This feature may not be available on all devices. Please refer to the
19742  specific device data sheet to determine availability or use
19743  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19744  this feature is available.
19745 */
19746 
19747 void
19749  PORTS_MODULE_ID index ,
19750  PORTS_CHANNEL channel ,
19751  PORTS_DATA_MASK mask ) ;
19752 // *****************************************************************************
19753 /* Function:
19754  PORTS_DATA_MASK PLIB_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
19755  Summary:
19756  Reads the direction of the selected digital port.
19757  Description:
19758  This function reads the direction of the selected digital port.
19759  This function does not perform atomic register access.
19760  Precondition:
19761  None.
19762  Parameters:
19763  index - Identifier for the device instance to be configured
19764  channel - Identifier for the Ports channel A, B, C, etc.
19765  Returns:
19766  Direction of the selected port of type PORTS_DATA_MASK
19767  Example:
19768  <code>
19769 
19770  // Reads the direction of Port C pins
19771  PORTS_DATA_MASK readDir = PLIB_PORTS_DirectionGet(PORTS_ID_0, PORT_CHANNEL_C);
19772 
19773  </code>
19774  Remarks:
19775  This feature may not be available on all devices. Please refer to the
19776  specific device data sheet to determine availability or use
19777  PLIB_PORTS_ExistsPortsDirection in your application to determine whether
19778  this feature is available.
19779 */
19780 
19783  PORTS_MODULE_ID index ,
19784  PORTS_CHANNEL channel ) ;
19785 // *****************************************************************************
19786 /* Function:
19787  void PLIB_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19788  PORTS_DATA_MASK mask )
19789  Summary:
19790  Enables the open drain functionality for the selected port pins.
19791  Description:
19792  This function enables the open drain functionality for the selected port pins.
19793  This function does not perform atomic register access.
19794  Precondition:
19795  None.
19796  Parameters:
19797  index - Identifier for the device instance to be configured
19798  channel - Identifier for the Ports channel A, B, C, etc.
19799  mask - Identifies the pins for the open drain to be enabled
19800  Returns:
19801  None.
19802  Example:
19803  <code>
19804 
19805  // Enable Open Drain for RC0, RC1 and RC2 pins
19806  PLIB_PORTS_OpenDrainEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19807 
19808  </code>
19809  Remarks:
19810  This feature may not be available on all devices. Please refer to the
19811  specific device data sheet to determine availability or use
19812  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19813  this feature is available.
19814 */
19815 
19816 void
19818  PORTS_MODULE_ID index ,
19819  PORTS_CHANNEL channel ,
19820  PORTS_DATA_MASK mask ) ;
19821 // *****************************************************************************
19822 /* Function:
19823  void PLIB_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
19824  PORTS_DATA_MASK mask )
19825  Summary:
19826  Disables the open drain functionality for the selected port.
19827  Description:
19828  This function disables the open drain functionality for the selected port.
19829  This function does not perform atomic register access.
19830 
19831  Precondition:
19832  None.
19833  Parameters:
19834  index - Identifier for the device instance to be configured
19835  channel - Identifier for the Ports channel A, B, C, etc.
19836  mask - Identifies the pins for the open drain to be disabled
19837  Returns:
19838  None.
19839  Example:
19840  <code>
19841 
19842  // Disable Open Drain for RC0, RC1 and RC2 pins
19843  PLIB_PORTS_OpenDrainDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0007);
19844 
19845  </code>
19846  Remarks:
19847  This feature may not be available on all devices. Please refer to the
19848  specific device data sheet to determine availability or use
19849  PLIB_PORTS_ExistsPortsOpenDrain in your application to determine whether
19850  this feature is available.
19851 */
19852 
19853 void
19855  PORTS_MODULE_ID index ,
19856  PORTS_CHANNEL channel ,
19857  PORTS_DATA_MASK mask ) ;
19858 // *****************************************************************************
19859 /* Function:
19860  void PLIB_PORTS_ChannelModeSelect
19861  (
19862  PORTS_MODULE_ID index,
19863  PORTS_CHANNEL channel,
19864  PORTS_DATA_MASK modeMask,
19865  PORTS_PIN_MODE mode
19866  );
19867  Summary:
19868  Enables the selected channel pins as analog or digital.
19869  Description:
19870  This function enables the selected channel pins as analog or digital.
19871  This function does not perform atomic register access.
19872  Precondition:
19873  None.
19874  Parameters:
19875  index - Identifier for the device instance to be configured
19876  channel - Port pin channel
19877  modeMask - Identifies the pins whose mode has to be modified.
19878  Modes of the pins whose corresponding bit is '1' get
19879  modified, mode of the other pins remains the same.
19880  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
19881  Returns:
19882  None.
19883  Example:
19884  <code>
19885 
19886  // Make pins RC5, RC8 and RC13 Analog
19887  PLIB_PORTS_ChannelModeSelect(PORTS_ID_0, PORT_CHANNEL_C, 0x2120, PORTS_PIN_MODE_ANALOG);
19888 
19889  </code>
19890  Remarks:
19891  This function is only available in devices with PPS. For Non-PPS devices, use the
19892  PLIB_PORTS_AnPinsModeSelect function.
19893 
19894  This feature may not be available on all devices. Please refer to the
19895  specific device data sheet to determine availability or use
19896  PLIB_PORTS_ExistsPinModePerPort in your application to determine whether
19897  this feature is available.
19898 */
19899 
19900 void
19902  PORTS_MODULE_ID index ,
19903  PORTS_CHANNEL channel ,
19904  PORTS_DATA_MASK modeMask ,
19905  PORTS_PIN_MODE mode ) ;
19906 // *****************************************************************************
19907 /* Function:
19908  void PLIB_PORTS_ChannelChangeNoticePullUpEnable
19909  (
19910  PORTS_MODULE_ID index,
19911  PORTS_CHANNEL channel,
19912  PORTS_DATA_MASK mask
19913  );
19914  Summary:
19915  Enables Change Notice pull-up for the selected channel pins.
19916  Description:
19917  This function enables the Change Notice pull-up for the selected
19918  channel pins.
19919  This function does not perform atomic register access.
19920  Precondition:
19921  None.
19922  Parameters:
19923  index - Identifier for the device instance to be configured
19924  channel - Port pin channel
19925  mask - Identifies the pins of the pull-up to be enabled
19926  Returns:
19927  None.
19928  Example:
19929  <code>
19930 
19931  // Enable pull-up for RC5, RC8 and RC13 pins
19932  PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_ID_0, PORT_CHANNEL_C,
19933  0x2120);
19934  </code>
19935  Remarks:
19936  This function is only available in devices with PPS. For Non-PPS devices, use the
19937  PLIB_PORTS_CnPinsPullUpEnable function.
19938 
19939  This feature may not be available on all devices. Please refer to the
19940  specific device data sheet to determine availability or use
19941  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19942  determine whether this feature is available.
19943 */
19944 
19945 void
19947  PORTS_MODULE_ID index ,
19948  PORTS_CHANNEL channel ,
19949  PORTS_DATA_MASK mask ) ;
19950 // *****************************************************************************
19951 /* Function:
19952  void PLIB_PORTS_ChannelChangeNoticePullUpDisable
19953  (
19954  PORTS_MODULE_ID index,
19955  PORTS_CHANNEL channel,
19956  PORTS_DATA_MASK mask
19957  );
19958  Summary:
19959  Disables Change Notice pull-up for the selected channel pins.
19960  Description:
19961  This function Disables the Change Notice pull-up for the selected
19962  channel pins.
19963  PLIB_PORTS_ChannelChangeNoticePullUpDisable
19964  Precondition:
19965  None.
19966  Parameters:
19967  index - Identifier for the device instance to be configured
19968  channel - Port pin channel
19969  mask - Identifies the pins of the pull-up to be disabled
19970  Returns:
19971  None.
19972  Example:
19973  <code>
19974 
19975  // Disable pull-up for RC5, RC8 and RC13 pins
19976  PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_ID_0, PORT_CHANNEL_C,
19977  0x2120);
19978  </code>
19979  Remarks:
19980  This function is only available in devices with PPS. For Non-PPS devices, use the
19981  PLIB_PORTS_CnPinsPullUpDisable function.
19982 
19983  This feature may not be available on all devices. Please refer to the
19984  specific device data sheet to determine availability or use
19985  PLIB_PORTS_ExistsChangeNoticePullUpPerPort in your application to
19986  determine whether this feature is available.
19987 */
19988 
19989 void
19991  PORTS_MODULE_ID index ,
19992  PORTS_CHANNEL channel ,
19993  PORTS_DATA_MASK mask ) ;
19994 // *****************************************************************************
19995 /* Function:
19996  void PLIB_PORTS_ChannelChangeNoticePullDownEnable
19997  (
19998  PORTS_MODULE_ID index,
19999  PORTS_CHANNEL channel,
20000  PORTS_DATA_MASK mask
20001  );
20002  Summary:
20003  Enables Change Notice pull-down for the selected channel pins.
20004  Description:
20005  This function enables the Change Notice pull-down for the selected
20006  channel pins.
20007  This function does not perform atomic register access.
20008  Precondition:
20009  None.
20010  Parameters:
20011  index - Identifier for the device instance to be configured
20012  channel - Port pin channel
20013  mask - Identifies the pins for the pull-down to be enabled
20014  Returns:
20015  None.
20016  Example:
20017  <code>
20018 
20019  // Enable pull-down for RC5, RC8 and RC13 pins
20020  PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_ID_0, PORT_CHANNEL_C,
20021  0x2120);
20022  </code>
20023  Remarks:
20024  This feature may not be available on all devices. Please refer to the
20025  specific device data sheet to determine availability or use
20026  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20027  determine whether this feature is available.
20028 */
20029 
20030 void
20032  PORTS_MODULE_ID index ,
20033  PORTS_CHANNEL channel ,
20034  PORTS_DATA_MASK mask ) ;
20035 // *****************************************************************************
20036 /* Function:
20037  void PLIB_PORTS_ChannelChangeNoticePullDownDisable
20038  (
20039  PORTS_MODULE_ID index,
20040  PORTS_CHANNEL channel,
20041  PORTS_DATA_MASK mask
20042  );
20043  Summary:
20044  Disables Change Notice pull-down for the selected channel pins.
20045  Description:
20046  This function Disables the Change Notice pull-down for the selected
20047  channel pins.
20048  This function does not perform atomic register access.
20049  Precondition:
20050  None.
20051  Parameters:
20052  index - Identifier for the device instance to be configured
20053  channel - Port pin channel
20054  mask - Identifies the pins for the pull-down to be disabled
20055  Returns:
20056  None.
20057  Example:
20058  <code>
20059 
20060  // Disable pull-down for RC5, RC8 and RC13 pins
20061  PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_ID_0, PORT_CHANNEL_C,
20062  0x2120);
20063  </code>
20064  Remarks:
20065  This feature may not be available on all devices. Please refer to the
20066  specific device data sheet to determine availability or use
20067  PLIB_PORTS_ExistsChangeNoticePullDownPerPort in your application to
20068  determine whether this feature is available.
20069 */
20070 
20071 void
20073  PORTS_MODULE_ID index ,
20074  PORTS_CHANNEL channel ,
20075  PORTS_DATA_MASK mask ) ;
20076 // *****************************************************************************
20077 /* Function:
20078  void PLIB_PORTS_ChannelChangeNoticeEnable
20079  (
20080  PORTS_MODULE_ID index,
20081  PORTS_CHANNEL channel,
20082  PORTS_DATA_MASK mask
20083  );
20084  Summary:
20085  Enables CN interrupt for the selected pins of a channel.
20086  Description:
20087  This function enables Change Notice interrupt for the selected port
20088  pins of a channel.
20089  This function does not perform atomic register access.
20090  Precondition:
20091  None.
20092  Parameters:
20093  index - Identifier for the device instance to be configured
20094  channel - Port pin channel
20095  mask - Identifies the pins for which change notification is
20096  to be enabled
20097  Returns:
20098  None.
20099  Example:
20100  <code>
20101 
20102  // Enable CN interrupt for RC5, RC8 and RC13 pins
20103  PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20104 
20105  </code>
20106  Remarks:
20107  This function is only available in devices with PPS. For Non-PPS devices, use the
20108  PLIB_PORTS_CnPinsEnable function.
20109 
20110  This feature may not be available on all devices. Please refer to the
20111  specific device data sheet to determine availability or use
20112  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20113  determine whether this feature is available.
20114 */
20115 
20116 void
20118  PORTS_MODULE_ID index ,
20119  PORTS_CHANNEL channel ,
20120  PORTS_DATA_MASK mask ) ;
20121 // *****************************************************************************
20122 /* Function:
20123  void PLIB_PORTS_ChannelChangeNoticeDisable
20124  (
20125  PORTS_MODULE_ID index,
20126  PORTS_CHANNEL channel,
20127  PORTS_DATA_MASK mask
20128  );
20129  Summary:
20130  Disables CN interrupt for the selected pins of a channel.
20131  Description:
20132  This function Disables Change Notice interrupt for the selected port
20133  pins of a channel.
20134  This function does not perform atomic register access.
20135  Precondition:
20136  None.
20137  Parameters:
20138  index - Identifier for the device instance to be configured
20139  channel - Port pin channel
20140  mask - Identifies the pins for which change notification is
20141  to be disabled
20142  Returns:
20143  None.
20144  Example:
20145  <code>
20146 
20147  // Disable CN interrupt for RC5, RC8 and RC13 pins
20148  PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x2120);
20149 
20150  </code>
20151  Remarks:
20152  This function is only available in devices with PPS. For Non-PPS devices, use the
20153  PLIB_PORTS_CnPinsDisable function.
20154 
20155  This feature may not be available on all devices. Please refer to the
20156  specific device data sheet to determine availability or use
20157  PLIB_PORTS_ExistsChangeNoticeIntPerPort in your application to
20158  determine whether this feature is available.
20159 */
20160 
20161 void
20163  PORTS_MODULE_ID index ,
20164  PORTS_CHANNEL channel ,
20165  PORTS_DATA_MASK mask ) ;
20166 // *****************************************************************************
20167 /* Function:
20168  void PLIB_PORTS_AnPinsModeSelect
20169  (
20170  PORTS_MODULE_ID index,
20171  PORTS_AN_PIN anPins,
20172  PORTS_PIN_MODE mode
20173  );
20174  Summary:
20175  Enables the selected AN pins as analog or digital.
20176  Description:
20177  This function enables the selected AN pins as analog or digital.
20178  This function does not perform atomic register access.
20179  Precondition:
20180  None.
20181  Parameters:
20182  index - Identifier for the device instance to be configured
20183  anPins - AN pins whose mode is to be changed. Multiple AN pins
20184  can be ORed.
20185  mode - Possible values of PORTS_PIN_MODE (Analog or Digital)
20186  Returns:
20187  None.
20188  Example:
20189  <code>
20190 
20191  // Make pins AN5, AN8 and AN13 Analog
20192  PLIB_PORTS_AnPinsModeSelect(PORTS_ID_0, PORTS_AN_PIN_5 |
20193  PORTS_AN_PIN_8 |
20194  PORTS_AN_PIN_13,
20195  PORTS_PIN_MODE_ANALOG);
20196 
20197  </code>
20198  Remarks:
20199  This function is only available in devices without PPS feature. For PPS
20200  devices, use the PLIB_PORTS_ChannelModeSelect function.
20201 
20202  This feature may not be available on all devices. Please refer to the
20203  specific device data sheet to determine availability or use
20204  PLIB_PORTS_ExistsAnPinsMode in your application to determine whether
20205  this feature is available.
20206 */
20207 
20208 void
20210  PORTS_MODULE_ID index ,
20211  PORTS_AN_PIN anPins ,
20212  PORTS_PIN_MODE mode ) ;
20213 // *****************************************************************************
20214 /* Function:
20215  void PLIB_PORTS_CnPinsPullUpEnable
20216  (
20217  PORTS_MODULE_ID index,
20218  PORTS_CN_PIN cnPins
20219  );
20220  Summary:
20221  Enables Change Notice pull-up for the selected channel pins.
20222  Description:
20223  This function enables the Change Notice pull-up for the selected
20224  channel pins.
20225  This function performs atomic register access.
20226  Precondition:
20227  None.
20228  Parameters:
20229  index - Identifier for the device instance to be configured
20230  cnPins - CN pins whose pull-up is to be enabled. Multiple CN pins
20231  can be ORed.
20232  Returns:
20233  None.
20234  Example:
20235  <code>
20236 
20237  // Enable pull-up for CN5, CN8 and CN13 pins
20238  PLIB_PORTS_CnPinsPullUpEnable(PORTS_ID_0, CHANGE_NOTICE_PIN_5 |
20239  CHANGE_NOTICE_PIN_8 |
20240  CHANGE_NOTICE_PIN_13);
20241 
20242  </code>
20243  Remarks:
20244  This function is only available in devices without PPS feature. For PPS
20245  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpEnable function.
20246 
20247  This feature may not be available on all devices. Please refer to the
20248  specific device data sheet to determine availability or use
20249  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20250  determine whether this feature is available.
20251 */
20252 
20253 void
20255  PORTS_MODULE_ID index ,
20256  PORTS_CN_PIN cnPins ) ;
20257 // *****************************************************************************
20258 /* Function:
20259  void PLIB_PORTS_CnPinsPullUpDisable
20260  (
20261  PORTS_MODULE_ID index,
20262  PORTS_CN_PIN cnPins
20263  );
20264  Summary:
20265  Disables Change Notice pull-up for the selected channel pins.
20266  Description:
20267  This function Disables the Change Notice pull-up for the selected
20268  channel pins.
20269  This function performs atomic register access.
20270  Precondition:
20271  None.
20272  Parameters:
20273  index - Identifier for the device instance to be configured
20274  cnPins - CN pins whose pull-up is to be disabled. Multiple CN pins
20275  can be ORed.
20276  Returns:
20277  None.
20278  Example:
20279  <code>
20280 
20281  // Disable pull-up for CN5, CN8 and CN13 pins
20282  PLIB_PORTS_CnPinsPullUpDisable(PORTS_ID_0,
20283  CHANGE_NOTICE_PIN_5 |
20284  CHANGE_NOTICE_PIN_8 |
20285  CHANGE_NOTICE_PIN_13);
20286 
20287  </code>
20288  Remarks:
20289  This function is only available in devices without PPS feature. For PPS
20290  devices, use the PLIB_PORTS_ChannelChangeNoticePullUpDisable function.
20291 
20292  This feature may not be available on all devices. Please refer to the
20293  specific device data sheet to determine availability or use
20294  PLIB_PORTS_ExistsChangeNoticePullUp in your application to
20295  determine whether this feature is available.
20296 */
20297 
20298 void
20300  PORTS_MODULE_ID index ,
20301  PORTS_CN_PIN cnPins ) ;
20302 // *****************************************************************************
20303 /* Function:
20304  void PLIB_PORTS_CnPinsEnable
20305  (
20306  PORTS_MODULE_ID index,
20307  PORTS_CN_PIN cnPins
20308  );
20309  Summary:
20310  Enables CN interrupt for the selected pins of a channel.
20311  Description:
20312  This function enables Change Notice interrupt for the selected port
20313  pins of a channel.
20314  This function performs atomic register access.
20315  Precondition:
20316  None.
20317  Parameters:
20318  index - Identifier for the device instance to be configured
20319  cnPins - CN pins to be enabled. Multiple CN pins can be ORed.
20320  Returns:
20321  None.
20322  Example:
20323  <code>
20324 
20325  // Enable CN interrupt for CN5, CN8 and CN13 pins
20326  PLIB_PORTS_CnPinsEnable(PORTS_ID_0,
20327  CHANGE_NOTICE_PIN_5 |
20328  CHANGE_NOTICE_PIN_8 |
20329  CHANGE_NOTICE_PIN_13);
20330 
20331  </code>
20332  Remarks:
20333  This function is only available in devices without PPS feature. For PPS
20334  devices, use the PLIB_PORTS_ChannelChangeNoticeEnable function.
20335 
20336  This feature may not be available on all devices. Please refer to the
20337  specific device data sheet to determine availability or use
20338  PLIB_PORTS_ExistsPinChangeNotice in your application to
20339  determine whether this feature is available.
20340 */
20341 
20342 void
20344  PORTS_MODULE_ID index ,
20345  PORTS_CN_PIN cnPins ) ;
20346 // *****************************************************************************
20347 /* Function:
20348  void PLIB_PORTS_CnPinsDisable
20349  (
20350  PORTS_MODULE_ID index,
20351  PORTS_CN_PIN cnPins
20352  );
20353  Summary:
20354  Disables CN interrupt for the selected pins of a channel.
20355  Description:
20356  This function Disables Change Notice interrupt for the selected port
20357  pins of a channel.
20358  This function performs atomic register access.
20359  Precondition:
20360  None.
20361  Parameters:
20362  index - Identifier for the device instance to be configured
20363  cnPins - CN pins to be disabled. Multiple CN pins can be ORed.
20364  Returns:
20365  None.
20366  Example:
20367  <code>
20368 
20369  // Disable CN interrupt for CN5, CN8 and CN13 pins
20370  PLIB_PORTS_CnPinsDisable(PORTS_ID_0,
20371  CHANGE_NOTICE_PIN_5 |
20372  CHANGE_NOTICE_PIN_8 |
20373  CHANGE_NOTICE_PIN_13);
20374 
20375  </code>
20376  Remarks:
20377  This function is only available in devices without PPS feature. For PPS
20378  devices, use the PLIB_PORTS_ChannelChangeNoticeDisable function.
20379 
20380  This feature may not be available on all devices. Please refer to the
20381  specific device data sheet to determine availability or use
20382  PLIB_PORTS_ExistsPinChangeNotice in your application to
20383  determine whether this feature is available.
20384 */
20385 
20386 void
20388  PORTS_MODULE_ID index ,
20389  PORTS_CN_PIN cnPins ) ;
20390 // *****************************************************************************
20391 /* Function:
20392  void PLIB_PORTS_ChangeNoticeEnable( PORTS_MODULE_ID index )
20393  Summary:
20394  Global Change Notice enable.
20395  Description:
20396  This function enables the global Change Notice feature.
20397  This function performs atomic register access.
20398  Precondition:
20399  None.
20400  Parameters:
20401  index - Identifier for the device instance to be configured
20402  Returns:
20403  None.
20404  Example:
20405  <code>
20406 
20407  // Enable Change Notification
20408  PLIB_PORTS_ChangeNoticeEnable(PORTS_ID_0);
20409 
20410  </code>
20411  Remarks:
20412  This function is only available in devices without PPS. For PPS devices, use the
20413  PLIB_PORTS_ChangeNoticePerPortTurnOn function.
20414 
20415  This feature may not be available on all devices. Please refer to the
20416  specific device data sheet to determine availability or use
20417  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20418  this feature is available.
20419 */
20420 
20421 void
20423  PORTS_MODULE_ID index ) ;
20424 // *****************************************************************************
20425 /* Function:
20426  void PLIB_PORTS_ChangeNoticeDisable( PORTS_MODULE_ID index )
20427  Summary:
20428  Global Change Notice disable.
20429  Description:
20430  This function disables the global Change Notice feature.
20431  Precondition:
20432  None.
20433  Parameters:
20434  index - Identifier for the device instance to be configured
20435  Returns:
20436  None.
20437  Example:
20438  <code>
20439 
20440  // Disable Change Notification
20441  PLIB_PORTS_ChangeNoticeDisable(PORTS_ID_0);
20442 
20443  </code>
20444  Remarks:
20445  This function is only available in devices without PPS. For PPS devices, use the
20446  PLIB_PORTS_ChangeNoticePerPortTurnOff function.
20447 
20448  This feature may not be available on all devices. Please refer to the
20449  specific device data sheet to determine availability or use
20450  PLIB_PORTS_ExistsChangeNotice in your application to determine whether
20451  this feature is available.
20452 */
20453 
20454 void
20456  PORTS_MODULE_ID index ) ;
20457 // *****************************************************************************
20458 /* Function:
20459  void PLIB_PORTS_PinChangeNoticeEnable( PORTS_MODULE_ID index,
20460  PORTS_CHANGE_NOTICE_PIN pinNum )
20461  Summary:
20462  Port pin Change Notice interrupt enable.
20463  Description:
20464  This function enables the port pin Change Notice feature.
20465  This function performs atomic register access.
20466  Precondition:
20467  None.
20468  Parameters:
20469  index - Identifier for the device instance to be configured
20470  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20471  Returns:
20472  None.
20473  Example:
20474  <code>
20475 
20476  // Enable Change Notice interrupt for pin CN13
20477  PLIB_PORTS_PinChangeNoticeEnable(PORTS_ID_0, CN13);
20478 
20479  </code>
20480  Remarks:
20481  This function is only available in devices without PPS. For PPS devices, use the
20482  PLIB_PORTS_PinChangeNoticePerPortEnable function.
20483 
20484  This feature may not be available on all devices. Please refer to the
20485  specific device data sheet to determine availability or use
20486  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20487  this feature is available.
20488 */
20489 
20490 void
20492  PORTS_MODULE_ID index ,
20493  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20494 // *****************************************************************************
20495 /* Function:
20496  void PLIB_PORTS_PinChangeNoticeDisable( PORTS_MODULE_ID index,
20497  PORTS_CHANGE_NOTICE_PIN pinNum )
20498  Summary:
20499  Port pin Change Notice disable.
20500  Description:
20501  This function disables the port pin Change Notice feature.
20502  This function performs atomic register access.
20503  Precondition:
20504  None.
20505  Parameters:
20506  index - Identifier for the device instance to be configured
20507  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20508  Returns:
20509  None.
20510  Example:
20511  <code>
20512 
20513  // Disable Change Notice interrupt for pin CN13
20514  PLIB_PORTS_PinChangeNoticeDisable(PORTS_ID_0, CN13);
20515 
20516  </code>
20517  Remarks:
20518  This function is only available in devices without PPS. For PPS devices, use the
20519  PLIB_PORTS_PinChangeNoticePerPortDisable function.
20520 
20521  This feature may not be available on all devices. Please refer to the
20522  specific device data sheet to determine availability or use
20523  PLIB_PORTS_ExistsPinChangeNotice in your application to determine whether
20524  this feature is available.
20525 */
20526 
20527 void
20529  PORTS_MODULE_ID index ,
20530  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20531 // *****************************************************************************
20532 /* Function:
20533  void PLIB_PORTS_ChangeNoticeInIdleEnable( PORTS_MODULE_ID index )
20534  Summary:
20535  CPU Idle mode does not affect Change Notice operation.
20536  Description:
20537  This function makes sure that Change Notice feature continues working in
20538  Idle mode.
20539  This function performs atomic register access.
20540 
20541  Precondition:
20542  None.
20543  Parameters:
20544  index - Identifier for the device instance to be configured
20545  Returns:
20546  None.
20547  Example:
20548  <code>
20549 
20550  // Change notification feature will be working even when CPU goes to
20551  // Idle mode
20552  PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_ID_0);
20553 
20554  </code>
20555  Remarks:
20556  This function is only available in devices without PPS. For PPS devices, use the
20557  PLIB_PORTS_ChangeNoticeInIdlePerPortEnable function.
20558 
20559  This feature may not be available on all devices. Please refer to the
20560  specific device data sheet to determine availability or use
20561  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20562  this feature is available.
20563 */
20564 
20565 void
20567  PORTS_MODULE_ID index ) ;
20568 // *****************************************************************************
20569 /* Function:
20570  void PLIB_PORTS_ChangeNoticeInIdleDisable( PORTS_MODULE_ID index )
20571  Summary:
20572  CPU Idle halts the Change Notice operation.
20573  Description:
20574  This function halts the Change Notice operation when the CPU enters
20575  Idle mode.
20576  This function performs atomic register access.
20577  Precondition:
20578  None.
20579  Parameters:
20580  index - Identifier for the device instance to be configured
20581  Returns:
20582  None.
20583  Example:
20584  <code>
20585  // Halts the Change notification operation when CPU enters Idle mode
20586  PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_ID_0);
20587 
20588  </code>
20589  Remarks:
20590  This function is only available in devices without PPS. For PPS devices, use the
20591  PLIB_PORTS_ChangeNoticeInIdlePerPortDisable function.
20592 
20593  This feature may not be available on all devices. Please refer to the
20594  specific device data sheet to determine availability or use
20595  PLIB_PORTS_ExistsChangeNoticeInIdle in your application to determine whether
20596  this feature is available.
20597 */
20598 
20599 void
20601  PORTS_MODULE_ID index ) ;
20602 // *****************************************************************************
20603 /* Function:
20604  void PLIB_PORTS_ChangeNoticePullUpEnable( PORTS_MODULE_ID index,
20605  PORTS_CHANGE_NOTICE_PIN pinNum )
20606  Summary:
20607  Enable pull-up on input change.
20608  Description:
20609  This function enables pull-up on selected input change notification pin.
20610  This function performs atomic register access.
20611  Precondition:
20612  None.
20613  Parameters:
20614  index - Identifier for the device instance to be configured
20615  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20616  Returns:
20617  None.
20618  Example:
20619  <code>
20620 
20621  // Enable pull-up on pin CN13
20622  PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_ID_0, CN13);
20623 
20624  </code>
20625  Remarks:
20626  This function is only available in devices without PPS. For PPS devices, use the
20627  PLIB_PORTS_ChangeNoticePullUpPerPortEnable function.
20628 
20629  This feature may not be available on all devices. Please refer to the
20630  specific device data sheet to determine availability or use
20631  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20632  this feature is available.
20633 */
20634 
20635 void
20637  PORTS_MODULE_ID index ,
20638  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20639 // *****************************************************************************
20640 /* Function:
20641  void PLIB_PORTS_ChangeNoticePullUpDisable( PORTS_MODULE_ID index,
20642  PORTS_CHANGE_NOTICE_PIN pinNum )
20643  Summary:
20644  Disable pull-up on input change.
20645  Description:
20646  This function disables pull-up on selected input change notification pin.
20647  This function performs atomic register access.
20648  Precondition:
20649  None.
20650  Parameters:
20651  index - Identifier for the device instance to be configured
20652  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
20653  Returns:
20654  None.
20655  Example:
20656  <code>
20657 
20658  // Disable pull-up on pin CN13
20659  PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_ID_0, CN13);
20660 
20661  </code>
20662  Remarks:
20663  This function is only available in devices without PPS. For PPS devices, use the
20664  PLIB_PORTS_ChangeNoticePullUpPerPortDisable function.
20665 
20666  This feature may not be available on all devices. Please refer to the
20667  specific device data sheet to determine availability or use
20668  PLIB_PORTS_ExistsChangeNoticePullUp in your application to determine whether
20669  this feature is available.
20670 */
20671 
20672 void
20674  PORTS_MODULE_ID index ,
20675  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
20676 // *****************************************************************************
20677 /* Function:
20678  void PLIB_PORTS_ChannelSlewRateSelect
20679  (
20680  PORTS_MODULE_ID index,
20681  PORTS_CHANNEL channel,
20682  PORTS_DATA_MASK channelMask,
20683  PORTS_PIN_SLEW_RATE slewRate
20684  );
20685  Summary:
20686  Selects the slew rate for selected channel pins.
20687  Description:
20688  This function selects the slew rate for selected channel pins.
20689  This function does not perform atomic register access.
20690  Precondition:
20691  None.
20692  Parameters:
20693  index - Identifier for the device instance to be configured
20694  channel - Port pin channel
20695  channelMask - Identifies the pins for which slew rate has to be modified.
20696  Slew rate of the pins which corresponding bit is "1" get
20697  modified, slew rate of the other pins remains the same.
20698  slewRate - One of the possible values of PORTS_PIN_SLEW_RATE.
20699  Returns:
20700  None.
20701  Example:
20702  <code>
20703 
20704  // Make slew rate of pins RC5, RC8 and RC13 slowest
20705  PLIB_PORTS_ChannelSlewRateSelect(PORTS_ID_0,
20706  PORT_CHANNEL_C,
20707  0x2120,
20708  PORTS_PIN_SLEW_RATE_SLOWEST);
20709 
20710  </code>
20711  Remarks:
20712  This feature may not be available on all devices. Please refer to the
20713  specific device data sheet to determine availability or use
20714  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20715  whether this feature is available.
20716 */
20717 
20718 void
20720  PORTS_MODULE_ID index ,
20721  PORTS_CHANNEL channel ,
20722  PORTS_DATA_MASK channelMask ,
20723  PORTS_PIN_SLEW_RATE slewRate ) ;
20724 // *****************************************************************************
20725 /* Function:
20726 PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet
20727  (
20728  PORTS_MODULE_ID index,
20729  PORTS_CHANNEL channel,
20730  PORTS_BIT_POS bitPos
20731  );
20732  Summary:
20733  Gets the slew rate for selected port pin.
20734  Description:
20735  This function gets the slew rate of selected port pin.
20736  This function does not perform atomic register access.
20737  Precondition:
20738  None.
20739  Parameters:
20740  index - Identifier for the device instance to be configured
20741  channel - Port pin channel
20742  bitPos - One of the possible values of PORTS_BIT_POS.
20743  Returns:
20744  One of the possible values of PORTS_PIN_SLEW_RATE.
20745  Example:
20746  <code>
20747  PORTS_PIN_SLEW_RATE slewRate;
20748 
20749  // Get the slew rate of pin RC1
20750  slewRate = PLIB_PORTS_PinSlewRateGet(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1);
20751 
20752  </code>
20753  Remarks:
20754  This feature may not be available on all devices. Please refer to the
20755  specific device data sheet to determine availability or use
20756  PLIB_PORTS_ExistsSlewRateControl in your application to determine
20757  whether this feature is available.
20758 */
20759 
20760 PORTS_PIN_SLEW_RATE
20762  PORTS_MODULE_ID index ,
20763  PORTS_CHANNEL channel ,
20764  PORTS_BIT_POS bitPos ) ;
20765 // *****************************************************************************
20766 /* Function:
20767  void PLIB_PORTS_ChannelChangeNoticeMethodSelect
20768  (
20769  PORTS_MODULE_ID index,
20770  PORTS_CHANNEL channel,
20771  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod
20772  );
20773  Summary:
20774  Selects the Change Notice style for selected port channel.
20775  Description:
20776  This function selects the Change Notice style (or method) for selected port
20777  channel. It allows user to select whether the Change Notice detection will
20778  happen based on edge transition or level transition on all the CN pins of a
20779  particular channel.
20780  This function does not perform atomic register access.
20781  Precondition:
20782  None.
20783  Parameters:
20784  index - Identifier for the device instance to be configured
20785  channel - Port pin channel
20786  changeNoticeMethod - One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20787  Returns:
20788  None.
20789  Example:
20790  <code>
20791  PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_ID_0, PORT_CHANNEL_C,
20792  PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT);
20793  </code>
20794  Remarks:
20795  This feature may not be available on all devices. Please refer to the
20796  specific device data sheet to determine availability or use
20797  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20798  whether this feature is available.
20799 */
20800 
20801 void
20803  PORTS_MODULE_ID index ,
20804  PORTS_CHANNEL channel ,
20805  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod ) ;
20806 // *****************************************************************************
20807 /* Function:
20808  PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet
20809  (
20810  PORTS_MODULE_ID index,
20811  PORTS_CHANNEL channel
20812  );
20813  Summary:
20814  Gets the Change Notice style for the selected port channel.
20815  Description:
20816  This function gets the Change Notice style (or method) for the selected port
20817  channel.
20818  This function does not perform atomic register access.
20819  Precondition:
20820  None.
20821  Parameters:
20822  index - Identifier for the device instance to be configured
20823  channel - Port pin channel
20824  Returns:
20825  One of the possible values of PORTS_CHANGE_NOTICE_METHOD.
20826  Example:
20827  <code>
20828  PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod;
20829  changeNoticeMethod = PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_ID_0, PORT_CHANNEL_C);
20830  </code>
20831  Remarks:
20832  This feature may not be available on all devices. Please refer to the
20833  specific device data sheet to determine availability or use
20834  PLIB_PORTS_ExistsChannelChangeNoticeMethod in your application to determine
20835  whether this feature is available.
20836 */
20837 
20838 PORTS_CHANGE_NOTICE_METHOD
20840  PORTS_MODULE_ID index ,
20841  PORTS_CHANNEL channel ) ;
20842 // *****************************************************************************
20843 /* Function:
20844  void PLIB_PORTS_ChannelChangeNoticeEdgeEnable
20845  (
20846  PORTS_MODULE_ID index,
20847  PORTS_CHANNEL channel,
20848  PORTS_DATA_MASK edgeRisingMask,
20849  PORTS_DATA_MASK edgeFallingMask
20850  );
20851  Summary:
20852  Enables selected type of edge for selected CN pins.
20853  Description:
20854  This function Enables selected type of edge (falling or rising) for
20855  selected CN pins of a port channel.
20856  This function does not perform atomic register access.
20857  Precondition:
20858  Change Notice method should be selected as
20859  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20860  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20861  Parameters:
20862  index - Identifier for the device instance to be configured
20863  channel - Port pin channel
20864  edgeRisingMask - Identifies the pins for which Change Notice has to be
20865  enabled for rising edge. Change Notice interrupt at rising
20866  edge is enabled for the pins which corresponding bit is
20867  '1', for the other pins it remains the same.
20868  edgeFallingMask - Identifies the pins for which Change Notice has to be
20869  enabled for falling edge. Change Notice interrupt at
20870  falling edge is enabled for the pins which corresponding
20871  bit is '1', for the other pins it remains the same.
20872  Returns:
20873  None.
20874  Example:
20875  <code>
20876  // Enable Change Notice at rising edge for RC1 pin and at falling edge for
20877  // RC1 & RC5 pins.
20878  PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20879  </code>
20880  Remarks:
20881  This feature is not available on all devices. Please refer to the
20882  specific device data sheet to determine availability or use
20883  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20884  whether this feature is available.
20885 */
20886 
20887 void
20889  PORTS_MODULE_ID index ,
20890  PORTS_CHANNEL channel ,
20891  PORTS_DATA_MASK edgeRisingMask ,
20892  PORTS_DATA_MASK edgeFallingMask ) ;
20893 // *****************************************************************************
20894 /* Function:
20895  void PLIB_PORTS_ChannelChangeNoticeEdgeDisable
20896  (
20897  PORTS_MODULE_ID index,
20898  PORTS_CHANNEL channel,
20899  PORTS_DATA_MASK edgeRisingMask,
20900  PORTS_DATA_MASK edgeFallingMask
20901  );
20902  Summary:
20903  Disables selected type of edge for selected CN pins.
20904  Description:
20905  This function Disables selected type of edge (falling or rising) for
20906  selected CN pins of a port channel.
20907  This function does not perform atomic register access.
20908  Precondition:
20909  Change Notice method should be selected as
20910  "PORTS_CHANGE_NOTICE_METHOD_EDGE_DETECT" using
20911  PLIB_PORTS_ChannelChangeNoticeMethodSelect before using this function.
20912  Parameters:
20913  index - Identifier for the device instance to be configured
20914  channel - Port pin channel
20915  edgeRisingMask - Identifies the pins for which Change Notice has to be
20916  enabled for rising edge. Change notice interrupt at rising
20917  edge is enabled for the pins which corresponding bit is
20918  '1', for the other pins it remains the same.
20919  edgeFallingMask - Identifies the pins for which Change Notice has to be
20920  enabled for falling edge. Change notice interrupt at
20921  falling edge is enabled for the pins which corresponding
20922  bit is '1', for the other pins it remains the same.
20923  Returns:
20924  None.
20925  Example:
20926  <code>
20927  // Disable Change Notice at rising edge for RC1 pin and at falling edge for
20928  // RC1 & RC5 pins.
20929  PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_ID_0, PORT_CHANNEL_C, 0x0002, 0x0022);
20930  </code>
20931  Remarks:
20932  This feature is not available on all devices. Please refer to the
20933  specific device data sheet to determine availability or use
20934  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20935  whether this feature is available.
20936 */
20937 
20938 void
20940  PORTS_MODULE_ID index ,
20941  PORTS_CHANNEL channel ,
20942  PORTS_DATA_MASK edgeRisingMask ,
20943  PORTS_DATA_MASK edgeFallingMask ) ;
20944 // *****************************************************************************
20945 /* Function:
20946  bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
20947  (
20948  PORTS_MODULE_ID index,
20949  PORTS_CHANNEL channel,
20950  PORTS_BIT_POS bitPos,
20951  PORTS_CHANGE_NOTICE_EDGE cnEdgeType
20952  );
20953  Summary:
20954  Check if Change Notice edge is enabled or not.
20955  This function does not perform atomic register access.
20956  Description:
20957  This function checks if selected type of Change Notice edge is enabled on a
20958  particular port pin or not.
20959  This function does not perform atomic register access.
20960  Precondition:
20961  None.
20962  Parameters:
20963  index - Identifier for the device instance to be configured
20964  channel - Port pin channel
20965  bitPos - One of the possible values of PORTS_BIT_POS.
20966  cnEdgeType - Type of the edge which has to be checked.
20967 
20968  Returns:
20969  - true - Selected type of Change Notice Edge is enabled.
20970  - false - Selected type of Change Notice Edge is not enabled.
20971 
20972  Example:
20973  <code>
20974  // Check if Change Notice at rising edge is enabled or not for pin RC1.
20975  if (PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1, PORTS_CHANGE_NOTICE_EDGE_RISING))
20976  {
20977  // do something
20978  }
20979  </code>
20980  Remarks:
20981  This feature is not available on all devices. Please refer to the
20982  specific device data sheet to determine availability or use
20983  PLIB_PORTS_ExistsChangeNoticeEdgeControl in your application to determine
20984  whether this feature is available.
20985 */
20986 
20987 bool
20989  PORTS_MODULE_ID index ,
20990  PORTS_CHANNEL channel ,
20991  PORTS_BIT_POS bitPos ,
20992  PORTS_CHANGE_NOTICE_EDGE cnEdgeType ) ;
20993 // *****************************************************************************
20994 /* Function:
20995  bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
20996  (
20997  PORTS_MODULE_ID index,
20998  PORTS_CHANNEL channel,
20999  PORTS_BIT_POS bitPos
21000  );
21001  Summary:
21002  Check Change Notice edge status.
21003  Description:
21004  This function checks whether or no a Change Notice edge transition has occurred
21005  on the selected port pin.
21006  This function does not perform atomic register access.
21007  Precondition:
21008  None.
21009  Parameters:
21010  index - Identifier for the device instance to be configured
21011  channel - Port pin channel
21012  bitPos - One of the possible values of PORTS_BIT_POS
21013 
21014  Returns:
21015  - true - Change Notice edge transition has occurred
21016  - false - Change Notice edge transition has not occurred
21017 
21018  Example:
21019  <code>
21020  // Check if Change Notice edge transition has occurred for pin RC1.
21021  if (PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_ID_0, PORT_CHANNEL_C, PORTS_BIT_POS_1))
21022  {
21023  // do something
21024  }
21025  </code>
21026  Remarks:
21027  This feature is not available on all devices. Please refer to the
21028  specific device data sheet to determine availability or use
21029  PLIB_PORTS_ExistsChangeNoticeEdgeStatus in your application to determine
21030  whether this feature is available.
21031 */
21032 
21033 bool
21035  PORTS_MODULE_ID index ,
21036  PORTS_CHANNEL channel ,
21037  PORTS_BIT_POS bitPos ) ;
21038 // *****************************************************************************
21039 // *****************************************************************************
21040 // Section: Ports Peripheral Library Exists Functions
21041 // *****************************************************************************
21042 // *****************************************************************************
21043 /* The functions below indicate the existence of the features on the device.
21044 */
21045 //******************************************************************************
21046 /* Function:
21047  PLIB_PORTS_ExistsRemapInput( PORTS_MODULE_ID index )
21048  Summary:
21049  Identifies whether the RemapInput feature exists on the Ports module.
21050  Description:
21051  This function identifies whether the RemapInput feature is available on the
21052  Ports module.
21053  When this function returns true, this function is supported on the device:
21054  - PLIB_PORTS_RemapInput
21055  Preconditions:
21056  None.
21057  Parameters:
21058  index - Identifier for the device instance
21059  Returns:
21060  - true - The RemapInput feature is supported on the device
21061  - false - The RemapInput feature is not supported on the device
21062  Remarks:
21063  None.
21064 */
21065 
21066 bool
21068  PORTS_MODULE_ID index ) ;
21069 //******************************************************************************
21070 /* Function:
21071  PLIB_PORTS_ExistsRemapOutput( PORTS_MODULE_ID index )
21072  Summary:
21073  Identifies whether the RemapOutput feature exists on the Ports module.
21074  Description:
21075  This function identifies whether the RemapOutput feature is available on the
21076  Ports module.
21077  When this function returns true, this function is supported on the device:
21078  - PLIB_PORTS_RemapOutput
21079  Preconditions:
21080  None.
21081  Parameters:
21082  index - Identifier for the device instance
21083  Returns:
21084  - true - The RemapOutput feature is supported on the device
21085  - false - The RemapOutput feature is not supported on the device
21086  Remarks:
21087  None.
21088 */
21089 
21090 bool
21092  PORTS_MODULE_ID index ) ;
21093 //******************************************************************************
21094 /* Function:
21095  PLIB_PORTS_ExistsPinMode( PORTS_MODULE_ID index )
21096  Summary:
21097  Identifies whether the PinMode feature exists on the Ports module.
21098  Description:
21099  This function identifies whether the PinMode (Analog Pin or Digital Pin)
21100  feature is available on the Ports module.
21101  When this function returns true, this function is supported on the device:
21102  - PLIB_PORTS_PinModeSelect
21103  Preconditions:
21104  None.
21105  Parameters:
21106  index - Identifier for the device instance
21107  Returns:
21108  - true - The PinMode feature is supported on the device
21109  - false - The PinMode feature is not supported on the device
21110  Remarks:
21111  None.
21112 */
21113 
21114 bool
21116  PORTS_MODULE_ID index ) ;
21117 //******************************************************************************
21118 /* Function:
21119  PLIB_PORTS_ExistsAnPinsMode( PORTS_MODULE_ID index )
21120  Summary:
21121  Identifies whether the AnPinsMode feature exists on the Ports module.
21122  Description:
21123  This function identifies whether the AnPinsMode feature is available on the
21124  Ports module.
21125  When this function returns true, this function is supported on the device:
21126  - PLIB_PORTS_AnPinsModeSelect
21127  Preconditions:
21128  None.
21129  Parameters:
21130  index - Identifier for the device instance
21131  Returns:
21132  - true - The AnPinsMode feature is supported on the device
21133  - false - The AnPinsMode feature is not supported on the device
21134  Remarks:
21135  None.
21136 */
21137 
21138 bool
21140  PORTS_MODULE_ID index ) ;
21141 //******************************************************************************
21142 /* Function:
21143  PLIB_PORTS_ExistsPortsRead( PORTS_MODULE_ID index )
21144  Summary:
21145  Identifies whether the PortsRead feature exists on the Ports module.
21146  Description:
21147  This function identifies whether the PortsRead feature is available on the
21148  Ports module.
21149  When this function returns true, these functions are supported on the device:
21150  - PLIB_PORTS_PinGet
21151  - PLIB_PORTS_Read
21152  Preconditions:
21153  None.
21154  Parameters:
21155  index - Identifier for the device instance
21156  Returns:
21157  - true - The PortsRead feature is supported on the device
21158  - false - The PortsRead feature is not supported on the device
21159  Remarks:
21160  None.
21161 */
21162 
21163 bool
21165  PORTS_MODULE_ID index ) ;
21166 //******************************************************************************
21167 /* Function:
21168  PLIB_PORTS_ExistsLatchRead( PORTS_MODULE_ID index )
21169  Summary:
21170  Identifies whether the LatchRead feature exists on the Ports module.
21171  Description:
21172  This function identifies whether the LatchRead feature is available on the
21173  Ports module.
21174  When this function returns true, these functions are supported on the device:
21175  - PLIB_PORTS_PinGetLatched
21176  - PLIB_PORTS_ReadLatched
21177  Preconditions:
21178  None.
21179  Parameters:
21180  index - Identifier for the device instance
21181  Returns:
21182  - true - The LatchRead feature is supported on the device
21183  - false - The LatchRead feature is not supported on the device
21184  Remarks:
21185  None.
21186 */
21187 
21188 bool
21190  PORTS_MODULE_ID index ) ;
21191 //******************************************************************************
21192 /* Function:
21193  PLIB_PORTS_ExistsPortsWrite( PORTS_MODULE_ID index )
21194  Summary:
21195  Identifies whether the PortsWrite feature exists on the Ports module.
21196  Description:
21197  This function identifies whether the PortsWrite feature is available on the
21198  Ports module.
21199  When this function returns true, these functions are supported on the device:
21200  - PLIB_PORTS_PinWrite
21201  - PLIB_PORTS_PinSet
21202  - PLIB_PORTS_PinClear
21203  - PLIB_PORTS_PinToggle
21204  - PLIB_PORTS_Write
21205  - PLIB_PORTS_Set
21206  - PLIB_PORTS_Toggle
21207  - PLIB_PORTS_Clear
21208  Preconditions:
21209  None.
21210  Parameters:
21211  index - Identifier for the device instance
21212  Returns:
21213  - true - The PortsWrite feature is supported on the device
21214  - false - The PortsWrite feature is not supported on the device
21215  Remarks:
21216  None.
21217 */
21218 
21219 bool
21221  PORTS_MODULE_ID index ) ;
21222 //******************************************************************************
21223 /* Function:
21224  PLIB_PORTS_ExistsPortsDirection( PORTS_MODULE_ID index )
21225  Summary:
21226  Identifies whether the PortsDirection feature exists on the Ports module.
21227  Description:
21228  This function identifies whether the PortsDirection feature is available on the
21229  Ports module.
21230  When this function returns true, these functions are supported on the device:
21231  - PLIB_PORTS_PinDirectionInputSet
21232  - PLIB_PORTS_PinDirectionOutputSet
21233  - PLIB_PORTS_DirectionInputSet
21234  - PLIB_PORTS_DirectionOutputSet
21235  - PLIB_PORTS_DirectionGet
21236  Preconditions:
21237  None.
21238  Parameters:
21239  index - Identifier for the device instance
21240  Returns:
21241  - true - The PortsDirection feature is supported on the device
21242  - false - The PortsDirection feature is not supported on the device
21243  Remarks:
21244  None.
21245 */
21246 
21247 bool
21249  PORTS_MODULE_ID index ) ;
21250 //******************************************************************************
21251 /* Function:
21252  PLIB_PORTS_ExistsPortsOpenDrain( PORTS_MODULE_ID index )
21253  Summary:
21254  Identifies whether the PortsOpenDrain feature exists on the Ports module.
21255  Description:
21256  This function identifies whether the PortsOpenDrain feature is available on
21257  the Ports module.
21258  When this function returns true, these functions are supported on the device:
21259  - PLIB_PORTS_PinOpenDrainEnable
21260  - PLIB_PORTS_PinOpenDrainDisable
21261  - PLIB_PORTS_OpenDrainEnable
21262  - PLIB_PORTS_OpenDrainDisable
21263  Preconditions:
21264  None.
21265  Parameters:
21266  index - Identifier for the device instance
21267  Returns:
21268  - true - The PortsOpenDrain feature is supported on the device
21269  - false - The PortsOpenDrain feature is not supported on the device
21270  Remarks:
21271  None.
21272 */
21273 
21274 bool
21276  PORTS_MODULE_ID index ) ;
21277 //******************************************************************************
21278 /* Function:
21279  PLIB_PORTS_ExistsChangeNotice( PORTS_MODULE_ID index )
21280  Summary:
21281  Identifies whether the ChangeNotice feature exists on the Ports module.
21282  Description:
21283  This function identifies whether the ChangeNotice feature is available on the
21284  Ports module.
21285  When this function returns true, these functions are supported on the device:
21286  - PLIB_PORTS_ChangeNoticeEnable
21287  - PLIB_PORTS_ChangeNoticeDisable
21288  Preconditions:
21289  None.
21290  Parameters:
21291  index - Identifier for the device instance
21292  Returns:
21293  - true - The ChangeNotice feature is supported on the device
21294  - false - The ChangeNotice feature is not supported on the device
21295  Remarks:
21296  None.
21297 */
21298 
21299 bool
21301  PORTS_MODULE_ID index ) ;
21302 //******************************************************************************
21303 /* Function:
21304  PLIB_PORTS_ExistsPinChangeNotice( PORTS_MODULE_ID index )
21305  Summary:
21306  Identifies whether the PinChangeNotice feature exists on the Ports module.
21307  Description:
21308  This function identifies whether the PinChangeNotice feature is available on
21309  the Ports module.
21310  When this function returns true, these functions are supported on the device:
21311  - PLIB_PORTS_PinChangeNoticeEnable
21312  - PLIB_PORTS_PinChangeNoticeDisable
21313  - PLIB_PORTS_CnPinsEnable
21314  - PLIB_PORTS_CnPinsDisable
21315  Preconditions:
21316  None.
21317  Parameters:
21318  index - Identifier for the device instance
21319  Returns:
21320  - true - The PinChangeNotice feature is supported on the device
21321  - false - The PinChangeNotice feature is not supported on the device
21322  Remarks:
21323  None.
21324 */
21325 
21326 bool
21328  PORTS_MODULE_ID index ) ;
21329 //******************************************************************************
21330 /* Function:
21331  PLIB_PORTS_ExistsChangeNoticeInIdle( PORTS_MODULE_ID index )
21332  Summary:
21333  Identifies whether the ChangeNoticeInIdle feature exists on the Ports module.
21334  Description:
21335  This function identifies whether the ChangeNoticeInIdle feature is available
21336  on the Ports module.
21337  When this function returns true, these functions are supported on the device:
21338  - PLIB_PORTS_ChangeNoticeInIdleEnable
21339  - PLIB_PORTS_ChangeNoticeInIdleDisable
21340  Preconditions:
21341  None.
21342  Parameters:
21343  index - Identifier for the device instance
21344  Returns:
21345  - true - The ChangeNoticeInIdle feature is supported on the device
21346  - false - The ChangeNoticeInIdle feature is not supported on the device
21347  Remarks:
21348  None.
21349 */
21350 
21351 bool
21353  PORTS_MODULE_ID index ) ;
21354 //******************************************************************************
21355 /* Function:
21356  PLIB_PORTS_ExistsChangeNoticePullUp( PORTS_MODULE_ID index )
21357  Summary:
21358  Identifies whether the ChangeNoticePullup feature exists on the Ports module.
21359  Description:
21360  This function identifies whether the ChangeNoticePullup feature is available
21361  on the Ports module.
21362  When this function returns true, these functions are supported on the device:
21363  - PLIB_PORTS_ChangeNoticePullUpEnable
21364  - PLIB_PORTS_ChangeNoticePullUpDisable
21365  - PLIB_PORTS_CnPinsPullUpEnable
21366  - PLIB_PORTS_CnPinsPullUpDisable
21367  Preconditions:
21368  None.
21369  Parameters:
21370  index - Identifier for the device instance
21371  Returns:
21372  - true - The ChangeNoticePullup feature is supported on the device
21373  - false - The ChangeNoticePullup feature is not supported on the device
21374  Remarks:
21375  None.
21376 */
21377 
21378 bool
21380  PORTS_MODULE_ID index ) ;
21381 //******************************************************************************
21382 /* Function:
21383  PLIB_PORTS_ExistsPinModePerPort( PORTS_MODULE_ID index )
21384  Summary:
21385  Identifies whether the PinModePerPort feature exists on the Ports module.
21386  Description:
21387  This function identifies whether the PinModePerPort (Analog Pin or Digital Pin)
21388  feature is available on the Ports module.
21389  When this function returns true, these functions are supported on the device:
21390  - PLIB_PORTS_PinModePerPortSelect
21391  - PLIB_PORTS_ChannelModeSelect
21392  Preconditions:
21393  None.
21394  Parameters:
21395  index - Identifier for the device instance
21396  Returns:
21397  - true - The PinModePerPort feature is supported on the device
21398  - false - The PinModePerPort feature is not supported on the device
21399  Remarks:
21400  None.
21401 */
21402 
21403 bool
21405  PORTS_MODULE_ID index ) ;
21406 //******************************************************************************
21407 /* Function:
21408  PLIB_PORTS_ExistsChangeNoticePullDownPerPort( PORTS_MODULE_ID index )
21409  Summary:
21410  Identifies whether the ChangeNoticePullDownPerPort feature exists on the
21411  Ports module.
21412  Description:
21413  This function identifies whether the ChangeNoticePullDownPerPort feature is
21414  available on the Ports module.
21415  When this function returns true, these functions are supported on the device:
21416  - PLIB_PORTS_ChangeNoticePullDownPerPortEnable
21417  - PLIB_PORTS_ChangeNoticePullDownPerPortDisable
21418  - PLIB_PORTS_ChannelChangeNoticePullDownEnable
21419  - PLIB_PORTS_ChannelChangeNoticePullDownDisable
21420  Preconditions:
21421  None.
21422  Parameters:
21423  index - Identifier for the device instance
21424  Returns:
21425  - true - The ChangeNoticePullDownPerPort feature is supported on the device
21426  - false - The ChangeNoticePullDownPerPort feature is not supported on the device
21427  Remarks:
21428  None.
21429 */
21430 
21431 bool
21433  PORTS_MODULE_ID index ) ;
21434 //******************************************************************************
21435 /* Function:
21436  PLIB_PORTS_ExistsChangeNoticePullUpPerPort( PORTS_MODULE_ID index )
21437  Summary:
21438  Identifies whether the ChangeNoticePullUpPerPort feature exists on the Ports
21439  module.
21440  Description:
21441  This function identifies whether the ChangeNoticePullUpPerPort feature is available
21442  on the Ports module.
21443  When this function returns true, these functions are supported on the device:
21444  - PLIB_PORTS_ChangeNoticePullUpPerPortEnable
21445  - PLIB_PORTS_ChangeNoticePullUpPerPortDisable
21446  - PLIB_PORTS_ChannelChangeNoticePullUpEnable
21447  - PLIB_PORTS_ChannelChangeNoticePullUpDisable
21448  Preconditions:
21449  None.
21450  Parameters:
21451  index - Identifier for the device instance
21452  Returns:
21453  - true - The ChangeNoticePullUpPerPort feature is supported on the device
21454  - false - The ChangeNoticePullUpPerPort feature is not supported on the device
21455  Remarks:
21456  None.
21457 */
21458 
21459 bool
21461  PORTS_MODULE_ID index ) ;
21462 //******************************************************************************
21463 /* Function:
21464  PLIB_PORTS_ExistsPinChangeNoticePerPort( PORTS_MODULE_ID index )
21465  Summary:
21466  Identifies whether the PinChangeNoticePerPort feature exists on the Ports
21467  module.
21468  Description:
21469  This function identifies whether the PinChangeNoticePerPort feature is
21470  available on the Ports module.
21471  When this function returns true, these functions are supported on the device:
21472  - PLIB_PORTS_PinChangeNoticePerPortEnable
21473  - PLIB_PORTS_PinChangeNoticePerPortDisable
21474  - PLIB_PORTS_ChannelChangeNoticeEnable
21475  - PLIB_PORTS_ChannelChangeNoticeDisable
21476  Preconditions:
21477  None.
21478  Parameters:
21479  index - Identifier for the device instance
21480  Returns:
21481  - true - The PinChangeNoticePerPort feature is supported on the device
21482  - false - The PinChangeNoticePerPort feature is not supported on the device
21483  Remarks:
21484  None.
21485 */
21486 
21487 bool
21489  PORTS_MODULE_ID index ) ;
21490 //******************************************************************************
21491 /* Function:
21492  PLIB_PORTS_ExistsChangeNoticePerPortTurnOn( PORTS_MODULE_ID index )
21493  Summary:
21494  Identifies whether the ChangeNoticePerPortTurnOn feature exists on the Ports
21495  module.
21496  Description:
21497  This function identifies whether the ChangeNoticePerPortTurnOn feature is
21498  available on the Ports module.
21499  When this function returns true, these functions are supported on the device:
21500  - PLIB_PORTS_ChangeNoticePerPortTurnOn
21501  - PLIB_PORTS_ChangeNoticePerPortTurnOff
21502  Preconditions:
21503  None.
21504  Parameters:
21505  index - Identifier for the device instance
21506  Returns:
21507  - true - The ChangeNoticePerPortTurnOn feature is supported on the device
21508  - false - The ChangeNoticePerPortTurnOn feature is not supported on the device
21509  Remarks:
21510  None.
21511 */
21512 
21513 bool
21515  PORTS_MODULE_ID index ) ;
21516 //******************************************************************************
21517 /* Function:
21518  PLIB_PORTS_ExistsChangeNoticePerPortInIdle( PORTS_MODULE_ID index )
21519  Summary:
21520  Identifies whether the ChangeNoticeInIdlePerPort feature exists on the Ports
21521  module.
21522  Description:
21523  This function identifies whether the ChangeNoticeInIdlePerPort feature is
21524  available on the Ports module.
21525  When this function returns true, these functions are supported on the device:
21526  - PLIB_PORTS_ChangeNoticeInIdlePerPortEnable
21527  - PLIB_PORTS_ChangeNoticeInIdlePerPortDisable
21528  Preconditions:
21529  None.
21530  Parameters:
21531  index - Identifier for the device instance
21532  Returns:
21533  - true - The ChangeNoticeInIdlePerPort feature is supported on the device
21534  - false - The ChangeNoticeInIdlePerPort feature is not supported on the device
21535  Remarks:
21536  None.
21537 */
21538 
21539 bool
21541  PORTS_MODULE_ID index ) ;
21542 //******************************************************************************
21543 /* Function:
21544  PLIB_PORTS_ExistsChangeNoticePerPortStatus( PORTS_MODULE_ID index )
21545  Summary:
21546  Identifies whether the ChangeNoticePerPortStatus feature exists on the Ports
21547  module.
21548  Description:
21549  This function identifies whether the ChangeNoticePerPortStatus feature is
21550  available on the Ports module.
21551  When this function returns true, these functions are supported on the device:
21552  - PLIB_PORTS_ChangeNoticePerPortHasOccured
21553  - PLIB_PORTS_ChangeNoticePerPortHasOccurred
21554  Preconditions:
21555  None.
21556  Parameters:
21557  index - Identifier for the device instance
21558  Returns:
21559  - true - The ChangeNoticePerPortStatus feature is supported on the device
21560  - false - The ChangeNoticePerPortStatus feature is not supported on the device
21561  Remarks:
21562  None.
21563 */
21564 
21565 bool
21567  PORTS_MODULE_ID index ) ;
21568 //******************************************************************************
21569 /* Function:
21570  PLIB_PORTS_ExistsSlewRateControl( PORTS_MODULE_ID index )
21571  Summary:
21572  Identifies whether the SlewRateControl feature exists on the Ports module.
21573  Description:
21574  This function identifies whether the SlewRateControl feature is available
21575  on the Ports module.
21576  When this function returns true, these functions are supported on the device:
21577  - PLIB_PORTS_ChannelSlewRateSelect
21578  - PLIB_PORTS_PinSlewRateGet
21579  Preconditions:
21580  None.
21581  Parameters:
21582  index - Identifier for the device instance
21583  Returns:
21584  - true - The SlewRateControl feature is supported on the device
21585  - false - The SlewRateControl feature is not supported on the device
21586  Remarks:
21587  None.
21588 */
21589 
21590 bool
21592  PORTS_MODULE_ID index ) ;
21593 //******************************************************************************
21594 /* Function:
21595  PLIB_PORTS_ExistsChannelChangeNoticeMethod( PORTS_MODULE_ID index )
21596  Summary:
21597  Identifies whether the ChannelChangeNoticeMethod feature exists on the
21598  Ports module.
21599  Description:
21600  This function identifies whether the ChannelChangeNoticeMethod feature is
21601  available on the Ports module.
21602  When this function returns true, these functions are supported on the device:
21603  - PLIB_PORTS_ChannelChangeNoticeMethodSelect
21604  - PLIB_PORTS_ChannelChangeNoticeMethodGet
21605  Preconditions:
21606  None.
21607  Parameters:
21608  index - Identifier for the device instance
21609  Returns:
21610  - true - The ChannelChangeNoticeMethod feature is supported on the device
21611  - false - The ChannelChangeNoticeMethod feature is not supported on the device
21612  Remarks:
21613  None.
21614 */
21615 
21616 bool
21618  PORTS_MODULE_ID index ) ;
21619 //******************************************************************************
21620 /* Function:
21621  PLIB_PORTS_ExistsChangeNoticeEdgeControl( PORTS_MODULE_ID index )
21622  Summary:
21623  Identifies whether the ChangeNoticeEdgeControl feature exists on the Ports
21624  module.
21625  Description:
21626  This function identifies whether the ChangeNoticeEdgeControl feature is
21627  available on the Ports module.
21628  When this function returns true, these functions are supported on the device:
21629  - PLIB_PORTS_ChannelChangeNoticeEdgeEnable
21630  - PLIB_PORTS_ChannelChangeNoticeEdgeDisable
21631  - PLIB_PORTS_PinChangeNoticeEdgeIsEnabled
21632  Preconditions:
21633  None.
21634  Parameters:
21635  index - Identifier for the device instance
21636  Returns:
21637  - true - The ChangeNoticeEdgeControl feature is supported on the device
21638  - false - The ChangeNoticeEdgeControl feature is not supported on the device
21639  Remarks:
21640  None.
21641 */
21642 
21643 bool
21645  PORTS_MODULE_ID index ) ;
21646 //******************************************************************************
21647 /* Function:
21648  PLIB_PORTS_ExistsChangeNoticeEdgeStatus( PORTS_MODULE_ID index )
21649  Summary:
21650  Identifies whether the ChangeNoticeEdgeStatus feature exists on the Ports
21651  module.
21652  Description:
21653  This function identifies whether the ChangeNoticeEdgeStatus feature is available
21654  on the Ports module.
21655  When this function returns true, this function is supported on the device:
21656  - PLIB_PORTS_PinChangeNoticeEdgeHasOccurred
21657  Preconditions:
21658  None.
21659  Parameters:
21660  index - Identifier for the device instance
21661  Returns:
21662  - true - The ChangeNoticeEdgeStatus feature is supported on the device
21663  - false - The ChangeNoticeEdgeStatus feature is not supported on the device
21664  Remarks:
21665  None.
21666 */
21667 
21668 bool
21670  PORTS_MODULE_ID index ) ;
21671 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h */
21672 /*******************************************************************************
21673  Ports Peripheral Library Compatibility Header
21674  Company:
21675  Microchip Technology Inc.
21676  File Name:
21677  plib_ports_compatibility.h
21678  Summary:
21679  Ports Peripheral Library Interface header for backward compatibility.
21680  Description:
21681  This header file contains the definitions of the functions which are
21682  supported for backward compatibility only. These will be deprecated later.
21683 *******************************************************************************/
21684 // DOM-IGNORE-BEGIN
21685 /*******************************************************************************
21686 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
21687 Microchip licenses to you the right to use, modify, copy and distribute
21688 Software only when embedded on a Microchip microcontroller or digital signal
21689 controller that is integrated into your product or third party product
21690 (pursuant to the sublicense terms in the accompanying license agreement).
21691 You should refer to the license agreement accompanying this Software for
21692 additional information regarding your rights and obligations.
21693 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
21694 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
21695 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
21696 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
21697 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
21698 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
21699 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
21700 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
21701 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
21702 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
21703 *******************************************************************************/
21704 // DOM-IGNORE-END
21705 #ifndef _PLIB_PORTS_COMPATIBILITY_H
21706 #define _PLIB_PORTS_COMPATIBILITY_H
21707 #include <stdint.h>
21708 #include <stddef.h>
21709 // *****************************************************************************
21710 /* Function:
21711  bool PLIB_PORTS_ChangeNoticePerPortHasOccured ( PORTS_MODULE_ID index,
21712  PORTS_CHANNEL channel, PORTS_BIT_POS bitPos );
21713  Summary:
21714  checks the status of change on the pin
21715  Description:
21716  This function checks if the change has occurred on the given pin or not.
21717  Precondition:
21718  None.
21719  Parameters:
21720  index - Identifier for the device instance to be configured
21721  channel - Port pin channel
21722  bitPos - Position in the PORT pins
21723  Returns:
21724  None.
21725  Example:
21726  <code>
21727 
21728  if(PLIB_PORTS_ChangeNoticePerPortHasOccured( PORTS_ID_0,
21729  PORT_CHANNEL_C, PORTS_BIT_POS_4 ) == True)
21730  {
21731  //do something
21732  }
21733 
21734  </code>
21735  Remarks:
21736  This feature may not be available on all devices. Please refer to the
21737  specific device data sheet to determine availability or use
21738  PLIB_PORTS_ExistsChangeNoticePerPortStatus in your application to determine
21739  whether this feature is available.
21740 
21741  This function will be deprecated later.
21742 */
21743 #define PLIB_PORTS_ChangeNoticePerPortHasOccured PLIB_PORTS_ChangeNoticePerPortHasOccurred
21744  // #ifndef _PLIB_PORTS_COMPATIBILITY_H
21745 /*******************************************************************************
21746  End of File
21747 */
21748 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports_compatibility.h*/
21749 /* CLOSE_FILE Include File */
21750 
21751 //DOM-IGNORE-BEGIN
21752 //DOM-IGNORE-END
21753  // #ifndef _PLIB_PORTS_H
21754 /*******************************************************************************
21755  End of File
21756 */
21757 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\ports\plib_ports.h*/
21758 /* CLOSE_FILE Include File */
21759 
21760 #include "system/int/sys_int.h"
21761 // *****************************************************************************
21762 // *****************************************************************************
21763 // Section: SYS PORTS Data Types
21764 // *****************************************************************************
21765 // *****************************************************************************
21766 // *****************************************************************************
21767 /* SYS PORTS PULLUP status
21768  Summary:
21769  Provides the pull-up and pull-down status.
21770  Description:
21771  These constants provide the pull-up or pull-down status definitions.
21772  Remarks:
21773  None.
21774 */
21775 
21776 typedef
21777  enum
21778  {
21779  /* PULLUP Disable */
21781  /*DOM-IGNORE-BEGIN*/
21782  = 0 /*DOM-IGNORE-END*/
21783  ,
21784  /* PULLUP Enable */
21786  /*DOM-IGNORE-BEGIN*/
21787  = 1 /*DOM-IGNORE-END*/
21788  ,
21790 // *****************************************************************************
21791 /* SYS PORTS PIN DIRECTION
21792  Summary:
21793  Defines the direction of the port pins.
21794  Description:
21795  These constants provide the port pin direction definitions.
21796  Remarks:
21797  None.
21798 */
21799 
21800 typedef
21801  enum
21802  {
21803  /* Direction as output */
21805  /*DOM-IGNORE-BEGIN*/
21806  = 0 /*DOM-IGNORE-END*/
21807  ,
21808  /* Direction as input */
21810  /*DOM-IGNORE-BEGIN*/
21811  = 1 /*DOM-IGNORE-END*/
21812  ,
21814 
21815 typedef
21816  enum
21817  {
21820  // #ifndef _SYS_PORTS_DEFINITIONS_H
21821 /*******************************************************************************
21822  End of File
21823 */
21824 
21825 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports_definitions.h*/
21826 /* CLOSE_FILE Include File */
21827 
21828 // DOM-IGNORE-BEGIN
21829 // DOM-IGNORE-END
21830 // *****************************************************************************
21831 // *****************************************************************************
21832 // Section: SYS PorTS Module Initialization Routine
21833 // *****************************************************************************
21834 // *****************************************************************************
21835 // *****************************************************************************
21836 /* Function:
21837  void SYS_PORTS_Initialize()
21838  Summary:
21839  Initializes PORT Pins/Channels.
21840  <p><b>Implementation:</b> Static/Dynamic</p>
21841  Description:
21842  This function initializes different port pins/channels to the desired state.
21843  It also remaps the pins to the desired specific function.
21844  Precondition:
21845  None.
21846  Parameters:
21847  None.
21848  Returns:
21849  None.
21850  Example:
21851  <code>
21852  SYS_PORTS_Initialize();
21853  </code>
21854  Remarks:
21855  This API must be be called at the time of system initialization to
21856  initialize the ports pins.
21857 */
21858 
21859 void
21861 // *****************************************************************************
21862 // *****************************************************************************
21863 // Section: SYS PORTS CONTROL Routines
21864 // *****************************************************************************
21865 // *****************************************************************************
21866 // *****************************************************************************
21867 /* Function:
21868  PORTS_DATA_TYPE SYS_PORTS_Read( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21869  Summary:
21870  Reads the data from the I/O port.
21871  <p><b>Implementation:</b> Dynamic</p>
21872  Description:
21873  This function reads the data from the I/O port.
21874  Preconditions:
21875  The direction of the port to be set as input.
21876  Parameters:
21877  index - Identifier for the device instance to be configured
21878  channel - Identifier for the PORT channel: A, B, C, etc.
21879  Returns:
21880  Returns the data read from the port.
21881  Example:
21882  <code>
21883  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21884  // application developer.
21885  PORTS_DATA_TYPE readData;
21886  readData = SYS_PORTS_Read( MY_PORTS_INSTANCE, MY_CHANNEL );
21887  </code>
21888  Remarks:
21889  None.
21890 */
21891 
21893  SYS_PORTS_Read (
21894  PORTS_MODULE_ID index ,
21895  PORTS_CHANNEL channel ) ;
21896 // *****************************************************************************
21897 /* Function:
21898  void SYS_PORTS_Write( PORTS_MODULE_ID index,
21899  PORTS_CHANNEL channel,
21900  PORTS_DATA_TYPE value )
21901  Summary:
21902  Writes the data to the I/O port.
21903  <p><b>Implementation:</b> Dynamic</p>
21904  Description:
21905  This function writes the data to the I/O port.
21906  Preconditions:
21907  The direction of the port to be set as output.
21908  Parameters:
21909  index - Identifier for the device instance to be configured
21910  channel - Identifier for the PORT channel: A, B, C, etc.
21911  value - Value to be written into a port of width PORTS_DATA_TYPE
21912  Returns:
21913  None.
21914  Example:
21915  <code>
21916  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21917  // application developer.
21918  PORTS_DATA_TYPE writeData;
21919  SYS_PORTS_Write( MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE );
21920  </code>
21921  Remarks:
21922  None.
21923 */
21924 
21925 void
21926  SYS_PORTS_Write (
21927  PORTS_MODULE_ID index ,
21928  PORTS_CHANNEL channel ,
21929  PORTS_DATA_TYPE value ) ;
21930 // *****************************************************************************
21931 /* Function:
21932  PORTS_DATA_TYPE SYS_PORTS_LatchedGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
21933  Summary:
21934  Reads the data driven on the I/O port.
21935  <p><b>Implementation:</b> Dynamic</p>
21936  Description:
21937  This function reads the data driven on the I/O port.
21938  Preconditions:
21939  The direction of the port to be set as output.
21940  Parameters:
21941  index - Identifier for the device instance to be configured
21942  channel - Identifier for the PORT channel: A, B, C, etc.
21943  Returns:
21944  Returns the data driven on the port.
21945  Example:
21946  <code>
21947  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21948  // application developer.
21949  PORTS_DATA_TYPE drivenData;
21950  drivenData = SYS_PORTS_LatchedGet( MY_PORTS_INSTANCE, MY_CHANNEL );
21951  </code>
21952  Remarks:
21953  None.
21954 */
21955 
21958  PORTS_MODULE_ID index ,
21959  PORTS_CHANNEL channel ) ;
21960 // *****************************************************************************
21961 /* Function:
21962  void SYS_PORTS_Set( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
21963  PORTS_DATA_TYPE value,
21964  PORTS_DATA_MASK mask )
21965  Summary:
21966  Sets the selected digital port/latch based on the mask.
21967  <p><b>Implementation:</b> Dynamic</p>
21968  Description:
21969  This function Sets the selected digital port/latch relative to the mask.
21970  This function "AND" value and mask parameters and then set the bits
21971  in the port channel that were set in the result of the ANDing operation.
21972  Preconditions:
21973  None.
21974  Parameters:
21975  index - Identifier for the device instance to be configured
21976  channel - Identifier for the PORT channel: A, B, C, etc.
21977  value - Consists of information about which port bit has to be set
21978  mask - Identifies the bits which could be intended for setting
21979  Returns:
21980  None.
21981  Example:
21982  <code>
21983  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
21984  // application developer.
21985  // MY_VALUE - 0x1234
21986  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
21987  // Set the MY_CHANNEL bit positions 2,4 and 5 (0x0034 = b0000 0000 0011 0100)
21988  SYS_PORTS_Set(MY_PORTS_INSTANCE, MY_CHANNEL, MY_VALUE, myMask);
21989  </code>
21990  Remarks:
21991  Not all features are available on all devices. Refer to the specific device
21992  data sheet for availability.
21993 */
21994 
21995 void
21996  SYS_PORTS_Set (
21997  PORTS_MODULE_ID index ,
21998  PORTS_CHANNEL channel ,
21999  PORTS_DATA_TYPE value ,
22000  PORTS_DATA_MASK mask ) ;
22001 // *****************************************************************************
22002 /* Function:
22003  void SYS_PORTS_Clear ( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22004  PORTS_DATA_MASK clearMask )
22005  Summary:
22006  Clears the selected digital port.
22007  <p><b>Implementation:</b> Dynamic</p>
22008  Description:
22009  This function clears the selected digital port.
22010  Preconditions:
22011  None.
22012  Parameters:
22013  index - Identifier for the device instance to be configured
22014  channel - Identifier for the PORT channel: A, B, C, etc.
22015  clearMask - Identifies the bits to be cleared
22016  Returns:
22017  None.
22018  Example:
22019  <code>
22020  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22021  // application developer.
22022  PORTS_DATA_MASK clearMask = (PORTS_DATA_MASK)0x00FF;
22023  SYS_PORTS_Clear( MY_PORTS_INSTANCE, MY_CHANNEL, clearMask );
22024  </code>
22025  Remarks:
22026  Not all features are available on all devices. Refer to the specific device
22027  data sheet for availability.
22028 */
22029 
22030 void
22031  SYS_PORTS_Clear (
22032  PORTS_MODULE_ID index ,
22033  PORTS_CHANNEL channel ,
22034  PORTS_DATA_MASK clearMask ) ;
22035 // *****************************************************************************
22036 /* Function:
22037  void SYS_PORTS_DirectionSelect( PORTS_MODULE_ID index,
22038  SYS_PORTS_PIN_DIRECTION pinDir,
22039  PORTS_CHANNEL channel,
22040  PORTS_DATA_MASK mask )
22041  Summary:
22042  Enables the direction for the selected port.
22043  <p><b>Implementation:</b> Dynamic</p>
22044  Description:
22045  This function enables the direction for the selected port.
22046  Preconditions:
22047  None.
22048  Parameters:
22049  index - Identifier for the device instance to be configured
22050  pinDir - Pin direction
22051  channel - Identifier for the PORT channel: A, B, C, etc.
22052  mask - Mask for the direction of width PORTS_DATA_MASK
22053  Returns:
22054  None
22055  Example:
22056  <code>
22057  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22058  // application developer.
22059  SYS_PORTS_PIN_DIRECTION pinDir;
22060  pinDir = SYS_PORTS_DIRECTION_INPUT;
22061  PORTS_DATA_MASK myMask = (PORTS_DATA_MASK)0x00FF;
22062  SYS_PORTS_DirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, myMask );
22063  </code>
22064  Remarks:
22065  None.
22066 */
22067 
22068 void
22070  PORTS_MODULE_ID index ,
22071  SYS_PORTS_PIN_DIRECTION pinDir ,
22072  PORTS_CHANNEL channel ,
22073  PORTS_DATA_MASK mask ) ;
22074 // *****************************************************************************
22075 /* Function:
22076  PORTS_DATA_MASK SYS_PORTS_DirectionGet( PORTS_MODULE_ID index, PORTS_CHANNEL channel )
22077  Summary:
22078  Reads the direction for the selected port.
22079  <p><b>Implementation:</b> Dynamic</p>
22080  Description:
22081  This function reads the direction for the selected port.
22082  Preconditions:
22083  None.
22084  Parameters:
22085  index - Identifier for the device instance to be configured
22086  channel - Identifier for the PORT channel: A, B, C, etc.
22087  Returns:
22088  Direction of the port.
22089  Example:
22090  <code>
22091  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22092  // application developer.
22093  PORTS_DATA_MASK value;
22094  value = SYS_PORTS_DirectionGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22095  </code>
22096  Remarks:
22097  None.
22098 */
22099 
22102  PORTS_MODULE_ID index ,
22103  PORTS_CHANNEL channel ) ;
22104 // *****************************************************************************
22105 /* Function:
22106  void SYS_PORTS_Toggle( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22107  PORTS_DATA_MASK toggleMask )
22108  Summary:
22109  Toggles the selected digital port pins.
22110  <p><b>Implementation:</b> Dynamic</p>
22111  Description:
22112  This function toggles the selected digital port pins.
22113  Preconditions:
22114  None.
22115  Parameters:
22116  index - Identifier for the device instance to be configured
22117  channel - Identifier for the PORT channel: A, B, C, etc.
22118  toggleMask - Identifies the bits to be toggled
22119  Returns:
22120  None.
22121  Example:
22122  <code>
22123  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22124  // application developer.
22125  PORTS_DATA_MASK toggleMask = (PORTS_DATA_MASK)0x00FF;
22126  SYS_PORTS_Toggle( MY_PORTS_INSTANCE, MY_CHANNEL, toggleMask );
22127  </code>
22128  Remarks:
22129  None.
22130 */
22131 
22132 void
22134  PORTS_MODULE_ID index ,
22135  PORTS_CHANNEL channel ,
22136  PORTS_DATA_MASK toggleMask ) ;
22137 // *****************************************************************************
22138 /* Function:
22139  void SYS_PORTS_OpenDrainEnable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22140  PORTS_DATA_MASK mask )
22141  Summary:
22142  Enables the open-drain functionality for the selected port.
22143  <p><b>Implementation:</b> Dynamic</p>
22144  Description:
22145  This function enables the open-drain functionality for the selected port.
22146  Preconditions:
22147  None.
22148  Parameters:
22149  index - Identifier for the device instance to be configured
22150  channel - Identifier for the PORT channel: A, B, C, etc.
22151  mask - Mask of type PORTS_DATA_MASK
22152  Returns:
22153  None.
22154  Example:
22155  <code>
22156  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22157  // application developer.
22158  SYS_PORTS_OpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22159  </code>
22160  Remarks:
22161  Not all features are available on all devices. Refer to the specific device
22162  data sheet for availability.
22163 */
22164 
22165 void
22167  PORTS_MODULE_ID index ,
22168  PORTS_CHANNEL channel ,
22169  PORTS_DATA_MASK mask ) ;
22170 // *****************************************************************************
22171 /* Function:
22172  void SYS_PORTS_OpenDrainDisable( PORTS_MODULE_ID index, PORTS_CHANNEL channel,
22173  PORTS_DATA_MASK mask )
22174  Summary:
22175  Disables the open-drain functionality for the selected port.
22176  <p><b>Implementation:</b> Dynamic</p>
22177  Description:
22178  This function disables the open-drain functionality for the selected port.
22179  Preconditions:
22180  None.
22181  Parameters:
22182  index - Identifier for the device instance to be configured
22183  channel - Identifier for the PORT channel: A, B, C, etc.
22184  mask - Mask of type PORTS_DATA_MASK
22185  Returns:
22186  None.
22187  Example:
22188  <code>
22189  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22190  // application developer.
22191  SYS_PORTS_PeripheralOpenDrainDisable( MY_PORTS_INSTANCE, MY_CHANNEL, (PORTS_DATA_MASK)0x00FF );
22192  </code>
22193  Remarks:
22194  Not all features are available on all devices. Refer to the specific device
22195  data sheet for availability.
22196 */
22197 
22198 void
22200  PORTS_MODULE_ID index ,
22201  PORTS_CHANNEL channel ,
22202  PORTS_DATA_MASK mask ) ;
22203 // *****************************************************************************
22204 /* Function:
22205  PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet
22206  (
22207  PORTS_MODULE_ID index,
22208  PORTS_CHANNEL channel
22209  )
22210  Summary:
22211  Reads the interrupt status from the I/O port.
22212  <p><b>Implementation:</b> Dynamic</p>
22213  Description:
22214  This function reads the interrupt status from the I/O port.
22215  Preconditions:
22216  The interrupts should have been configured.
22217  Parameters:
22218  index - Identifier for the device instance to be configured
22219  channel - Identifier for the PORT channel: A, B, C, etc.
22220  Returns:
22221  Returns the interrupt status of the port channel.
22222  Example:
22223  <code>
22224  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22225  // application developer.
22226  PORTS_DATA_TYPE channelStatus;
22227  channelStatus = SYS_PORTS_InterruptStatusGet( MY_PORTS_INSTANCE, MY_CHANNEL );
22228  </code>
22229  Remarks:
22230  None.
22231 */
22232 
22235  PORTS_MODULE_ID index ,
22236  PORTS_CHANNEL channel ) ;
22237 // *****************************************************************************
22238 // *****************************************************************************
22239 // Section: SYS PORT PINS REMAPING Routines
22240 // *****************************************************************************
22241 // *****************************************************************************
22242 // *****************************************************************************
22243 /* Function:
22244  void SYS_PORTS_RemapInput( PORTS_MODULE_ID index,
22245  PORTS_REMAP_INPUT_FUNCTION function,
22246  PORTS_REMAP_INPUT_PIN remapPin )
22247  Summary:
22248  Input/Output (I/O) function remapping.
22249  <p><b>Implementation:</b> Dynamic</p>
22250  Description:
22251  This function controls the I/O function remapping.
22252  Precondition:
22253  None.
22254  Parameters:
22255  index - Identifier for the device instance to be configured
22256  function - One of the possible values of PORTS_REMAP_INPUT_FUNCTION
22257  remapPin - One of the possible values of PORTS_REMAP_INPUT_PIN
22258  Returns:
22259  None.
22260  Example:
22261  <code>
22262  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22263  // application developer.
22264  // Remapping input function 'Input Capture 1' to the Remappable pin 'RPD2'
22265  SYS_PORTS_RemapInput(MY_PORTS_INSTANCE, INPUT_FUNC_IC1, INPUT_PIN_RPD2 );
22266  </code>
22267  Remarks:
22268  This feature may not be available on all devices. Please refer to the
22269  specific device data sheet to determine availability or use
22270  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22271  this feature is available.
22272 */
22273 
22274 void
22276  PORTS_MODULE_ID index ,
22277  PORTS_REMAP_INPUT_FUNCTION function ,
22278  PORTS_REMAP_INPUT_PIN remapPin ) ;
22279 // *****************************************************************************
22280 /* Function:
22281  void SYS_PORTS_RemapOutput( PORTS_MODULE_ID index,
22282  PORTS_REMAP_OUTPUT_FUNCTION function,
22283  PORTS_REMAP_OUTPUT_PIN remapPin )
22284  Summary:
22285  Input/Output (I/O) function remapping.
22286  <p><b>Implementation:</b> Dynamic</p>
22287  Description:
22288  This function controls the I/O function remapping.
22289  Precondition:
22290  None.
22291  Parameters:
22292  index - Identifier for the device instance to be configured
22293  function - One of the possible values of PORTS_REMAP_OUTPUT_FUNCTION
22294  remapPin - One of the possible values of PORTS_REMAP_OUTPUT_PIN
22295  Returns:
22296  None.
22297  Example:
22298  <code>
22299  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22300  // application developer.
22301  // Remapping output function 'UART3 Transmit' to the Remappable pin 'RPA14'
22302  SYS_PORTS_RemapInputOutput(MY_PORTS_INSTANCE, OUTPUT_FUNC_U3TX, OUTPUT_PIN_RPA14);
22303  </code>
22304  Remarks:
22305  This feature may not be available on all devices. Please refer to the
22306  specific device data sheet to determine availability or use
22307  SYS_PORTS_ExistsRemapInputOutput in your application to determine whether
22308  this feature is available.
22309 */
22310 
22311 void
22313  PORTS_MODULE_ID index ,
22314  PORTS_REMAP_OUTPUT_FUNCTION function ,
22315  PORTS_REMAP_OUTPUT_PIN remapPin ) ;
22316 // *****************************************************************************
22317 // *****************************************************************************
22318 // Section: SYS Change Notification Pins Routines
22319 // *****************************************************************************
22320 // *****************************************************************************
22321 // *****************************************************************************
22322 /* Function:
22323  void SYS_PORTS_ChangeNotificationGlobalEnable( PORTS_MODULE_ID index )
22324  Summary:
22325  Globally enables the change notification for the selected port.
22326  <p><b>Implementation:</b> Dynamic</p>
22327  Description:
22328  This function globally enables the change notification for the selected port.
22329  Preconditions:
22330  None.
22331  Parameters:
22332  None.
22333  Returns:
22334  None.
22335  Example:
22336  <code>
22337  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22338  // application developer.
22339  SYS_PORTS_ChangeNotificationGlobalEnable( MY_PORTS_INSTANCE );
22340  </code>
22341  Remarks:
22342  Not all features are available on all devices. Refer to the specific device
22343  data sheet for availability.
22344 */
22345 
22346 void
22348  PORTS_MODULE_ID index ) ;
22349 // *****************************************************************************
22350 /* Function:
22351  void SYS_PORTS_ChangeNotificationGlobalDisable( PORTS_MODULE_ID index );
22352  Summary:
22353  Globally disables the change notification for the selected port.
22354  <p><b>Implementation:</b> Dynamic</p>
22355  Description:
22356  This function globally disables the change notification for the selected port.
22357  Preconditions:
22358  None.
22359  Parameters:
22360  None.
22361  Returns:
22362  None.
22363  Example:
22364  <code>
22365  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22366  // application developer.
22367  SYS_PORTS_ChangeNotificationGlobalDisable( MY_PORTS_INSTANCE);
22368  </code>
22369  Remarks:
22370  Not all features are available on all devices. Refer to the specific device
22371  data sheet for availability.
22372 */
22373 
22374 void
22376  PORTS_MODULE_ID index ) ;
22377 // *****************************************************************************
22378 /* Function:
22379  void SYS_PORTS_ChangeNotificationEnable( PORTS_MODULE_ID index,
22380  PORTS_CHANGE_NOTICE_PIN pinNum,
22381  SYS_PORTS_PULLUP_PULLDOWN_STATUS value )
22382  Summary:
22383  Enables the change notification for the selected port.
22384  <p><b>Implementation:</b> Dynamic</p>
22385  Description:
22386  This function enables the change notification for the selected port.
22387  Preconditions:
22388  None.
22389  Parameters:
22390  index - Identifier for the device instance to be configured
22391  value - Pull-up enable or disable value
22392  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22393  Returns:
22394  None.
22395  Example:
22396  <code>
22397  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22398  // application developer.
22399  SYS_PORTS_PULLUP_PULLDOWN_STATUS value;
22400  PORTS_CHANGE_NOTICE_PIN pinNum;
22401  SYS_PORTS_ChangeNotificationEnable( index, pinNum, value );
22402  </code>
22403  Remarks:
22404  Not all features are available on all devices. Refer to the specific device
22405  data sheet for availability.
22406 */
22407 
22408 void
22410  PORTS_MODULE_ID index ,
22411  PORTS_CHANGE_NOTICE_PIN pinNum ,
22413 // *****************************************************************************
22414 /* Function:
22415  void SYS_PORTS_ChangeNotificationDisable( PORTS_MODULE_ID index,
22416  PORTS_CHANGE_NOTICE_PIN pinNum )
22417  Summary:
22418  Disables the change notification for the selected port.
22419  <p><b>Implementation:</b> Dynamic</p>
22420  Description:
22421  This function disables the change notification for the selected port.
22422  Preconditions:
22423  None.
22424  Parameters:
22425  index - Identifier for the device instance to be configured
22426  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22427  Returns:
22428  None.
22429  Example:
22430  <code>
22431  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22432  // application developer.
22433  PORTS_CHANGE_NOTICE_PIN pinNum;
22434  SYS_PORTS_ChangeNotificationDisable( index, pinNum );
22435  </code>
22436  Remarks:
22437  Not all features are available on all devices. Refer to the specific device
22438  data sheet for availability.
22439 */
22440 
22441 void
22443  PORTS_MODULE_ID index ,
22444  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22445 // *****************************************************************************
22446 /* Function:
22447  void SYS_PORTS_ChangeNotificationInIdleModeEnable( PORTS_MODULE_ID index );
22448  Summary:
22449  Enables the change notification for the selected port in Sleep or Idle mode.
22450  <p><b>Implementation:</b> Dynamic</p>
22451  Description:
22452  This function enables the change notification for the selected port in Sleep
22453  or Idle mode.
22454  Preconditions:
22455  None.
22456  Parameters:
22457  None.
22458  Returns:
22459  None.
22460  Example:
22461  <code>
22462  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22463  // application developer.
22464  SYS_PORTS_ChangeNotificationInIdleModeEnable( MY_PORTS_INSTANCE );
22465  </code>
22466  Remarks:
22467  Not all features are available on all devices. Refer to the specific device
22468  data sheet for availability.
22469 */
22470 
22471 void
22473  PORTS_MODULE_ID index ) ;
22474 // *****************************************************************************
22475 /* Function:
22476  void SYS_PORTS_ChangeNotificationInIdleModeDisable( PORTS_MODULE_ID index);
22477  Summary:
22478  Disables the change notification for the selected port in Sleep or Idle mode.
22479  <p><b>Implementation:</b> Dynamic</p>
22480  Description:
22481  This function disables the change notification for the selected port in Sleep
22482  or Idle mode.
22483  Preconditions:
22484  None.
22485  Parameters:
22486  None.
22487  Returns:
22488  None.
22489  Example:
22490  <code>
22491  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22492  // application developer.
22493  SYS_PORTS_ChangeNotificationInIdleModeDisable( MY_PORTS_INSTANCE );
22494  </code>
22495  Remarks:
22496  Not all features are available on all devices. Refer to the specific device
22497  data sheet for availability.
22498 */
22499 
22500 void
22502  PORTS_MODULE_ID index ) ;
22503 // *****************************************************************************
22504 /* Function:
22505  void SYS_PORTS_ChangeNotificationPullUpEnable ( PORTS_MODULE_ID index,
22506  PORTS_CHANGE_NOTICE_PIN pinNum )
22507  Summary:
22508  Enables a weak pull-up on the change notification pin.
22509  <p><b>Implementation:</b> Dynamic</p>
22510  Description:
22511  This function enables a weak pull-up on the change notification pin.
22512  Preconditions:
22513  None.
22514  Parameters:
22515  index - Identifier for the device instance to be configured
22516  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22517  Returns:
22518  None.
22519  Example:
22520  <code>
22521  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22522  // application developer.
22523  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22524  SYS_PORTS_ChangeNotificationPullUpEnable( MY_PORTS_INSTANCE, MY_PINNUM );
22525  </code>
22526  Remarks:
22527  Not all features are available on all devices. Refer to the specific device
22528  data sheet for availability.
22529 */
22530 
22531 void
22533  PORTS_MODULE_ID index ,
22534  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22535 // *****************************************************************************
22536 /* Function:
22537  void SYS_PORTS_ChangeNotificationPullUpDisable ( PORTS_MODULE_ID index,
22538  PORTS_CHANGE_NOTICE_PIN pinNum )
22539  Summary:
22540  Disables a weak pull-up on the change notification pin.
22541  <p><b>Implementation:</b> Dynamic</p>
22542  Description:
22543  This function Disables a weak pull-up on the change notification pin.
22544  Preconditions:
22545  None.
22546  Parameters:
22547  index - Identifier for the device instance to be configured
22548  pinNum - Possible values of PORTS_CHANGE_NOTICE_PIN
22549  Returns:
22550  None.
22551  Example:
22552  <code>
22553  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22554  // application developer.
22555  // MY_PINNUM - PORTS_CHANGE_NOTICE_PIN_10
22556  SYS_PORTS_ChangeNotificationPullUpDisable( MY_PORTS_INSTANCE, MY_PINNUM );
22557  </code>
22558  Remarks:
22559  Not all features are available on all devices. Refer to the specific device
22560  data sheet for availability.
22561 */
22562 
22563 void
22565  PORTS_MODULE_ID index ,
22566  PORTS_CHANGE_NOTICE_PIN pinNum ) ;
22567 // *****************************************************************************
22568 // *****************************************************************************
22569 // Section: SYS PORT PINS Control Routines
22570 // *****************************************************************************
22571 // *****************************************************************************
22572 // *****************************************************************************
22573 /* Function:
22574  void SYS_PORTS_PinModeSelect ( PORTS_MODULE_ID index,
22575  PORTS_ANALOG_PIN pin,
22576  PORTS_PIN_MODE mode)
22577  Summary:
22578  Enables the selected pin as analog or digital.
22579  <p><b>Implementation:</b> Dynamic</p>
22580  Description:
22581  This function enables the selected pin as analog or digital.
22582  Preconditions:
22583  None.
22584  Parameters:
22585  index - Identifier for the device instance to be configured
22586  pin - Possible values of PORTS_ANALOG_PIN
22587  mode - Possible values of PORTS_PIN_MODE
22588  Returns:
22589  None.
22590  Example:
22591  <code>
22592  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22593  // application developer.
22594  // MY_PIN - PORTS_ANALOG_PIN_AN0
22595  // MY_PIN_MODE - PORTS_PIN_MODE_ANALOG
22596  SYS_PORTS_PinModSYS_PORTS_PinModeSelecteSelect( MY_PORTS_INSTANCE, MY_PIN, MY_PIN_MODE );
22597  </code>
22598  Remarks:
22599  Not all features are available on all devices. Refer to the specific device
22600  data sheet for availability.
22601 */
22602 
22603 void
22605  PORTS_MODULE_ID index ,
22606  PORTS_ANALOG_PIN pin ,
22607  PORTS_PIN_MODE mode ) ;
22608 // *****************************************************************************
22609 /* Function:
22610  void SYS_PORTS_PinWrite ( PORTS_MODULE_ID index,
22611  PORTS_CHANNEL channel,
22612  PORTS_BIT_POS bitPos
22613  bool value )
22614  Summary:
22615  Writes the selected digital pin.
22616  <p><b>Implementation:</b> Dynamic</p>
22617  Description:
22618  This function writes the selected digital pin.
22619  Preconditions:
22620  None.
22621  Parameters:
22622  index - Identifier for the device instance to be configured
22623  channel - Identifier for the PORT channel: A, B, C, etc.
22624  bitPos - Possible values of PORTS_BIT_POS
22625  value - Value to be written to the specific pin/latch:
22626  - true - Sets the bit
22627  - false - Clears the bit
22628  Returns:
22629  None.
22630  Example:
22631  <code>
22632  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22633  // application developer.
22634  // MY_PINNUM - PORTS_PIN_10
22635  SYS_PORTS_PinWrite(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM, value);
22636  </code>
22637  Remarks:
22638  Not all features are available on all devices. Refer to the specific device
22639  data sheet for availability.
22640 */
22641 
22642 void
22644  PORTS_MODULE_ID index ,
22645  PORTS_CHANNEL channel ,
22646  PORTS_BIT_POS bitPos ,
22647  bool value ) ;
22648 // *****************************************************************************
22649 /* Function:
22650  bool SYS_PORTS_PinLatchedGet ( PORTS_MODULE_ID index,
22651  PORTS_CHANNEL channel,
22652  PORTS_BIT_POS bitPos )
22653  Summary:
22654  Reads the data driven on the selected digital pin.
22655  <p><b>Implementation:</b> Dynamic</p>
22656  Description:
22657  This function reads the data driven on the selected
22658  digital output pin.
22659  Preconditions:
22660  None.
22661  Parameters:
22662  index - Identifier for the device instance to be configured
22663  channel - Identifier for the PORT channel: A, B, C, etc.
22664  bitPos - Possible values of PORTS_BIT_POS
22665  Returns:
22666  The status of the data driven on the port pin.
22667  Example:
22668  <code>
22669  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22670  // application developer.
22671  // MY_PINNUM - PORTS_PIN_10
22672  status = SYS_PORTS_PinLatchedGet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22673  </code>
22674  Remarks:
22675  Not all features are available on all devices. Refer to the specific device
22676  data sheet for availability.
22677 */
22678 
22679 bool
22681  PORTS_MODULE_ID index ,
22682  PORTS_CHANNEL channel ,
22683  PORTS_BIT_POS bitPos ) ;
22684 // *****************************************************************************
22685 /* Function:
22686  bool SYS_PORTS_PinRead ( PORTS_MODULE_ID index,
22687  PORTS_CHANNEL channel,
22688  PORTS_BIT_POS bitPos )
22689  Summary:
22690  Reads the selected digital pin.
22691  <p><b>Implementation:</b> Dynamic</p>
22692  Description:
22693  This function reads the selected digital pin, not the Latch.
22694  Preconditions:
22695  None.
22696  Parameters:
22697  index - Identifier for the device instance to be configured
22698  channel - Identifier for the PORT channel: A, B, C, etc.
22699  bitPos - Possible values of PORTS_BIT_POS
22700  Returns:
22701  The status of the port pin.
22702  Example:
22703  <code>
22704  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22705  // application developer.
22706  // MY_PINNUM - PORTS_PIN_10
22707  bool bitStatus = SYS_PORTS_PinRead(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22708  </code>
22709  Remarks:
22710  Not all features are available on all devices. Refer to the specific device
22711  data sheet for availability.
22712 */
22713 
22714 bool
22716  PORTS_MODULE_ID index ,
22717  PORTS_CHANNEL channel ,
22718  PORTS_BIT_POS bitPos ) ;
22719 // *****************************************************************************
22720 /* Function:
22721  void SYS_PORTS_PinToggle ( PORTS_MODULE_ID index,
22722  PORTS_CHANNEL channel,
22723  PORTS_BIT_POS bitPos )
22724  Summary:
22725  Toggles the selected digital pin.
22726  <p><b>Implementation:</b> Dynamic</p>
22727  Description:
22728  This function toggles the selected digital pin.
22729  Preconditions:
22730  None.
22731  Parameters:
22732  index - Identifier for the device instance to be configured
22733  channel - Identifier for the PORT channel: A, B, C, etc.
22734  bitPos - Possible values of PORTS_BIT_POS
22735  Returns:
22736  None.
22737  Example:
22738  <code>
22739  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22740  // application developer.
22741  // MY_PINNUM - PORTS_PIN_10
22742  SYS_PORTS_PinToggle( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22743  </code>
22744  Remarks:
22745  Not all features are available on all devices. Refer to the specific device
22746  data sheet for availability.
22747 */
22748 
22749 void
22751  PORTS_MODULE_ID index ,
22752  PORTS_CHANNEL channel ,
22753  PORTS_BIT_POS bitPos ) ;
22754 // *****************************************************************************
22755 /* Function:
22756  void SYS_PORTS_PinSet( PORTS_MODULE_ID index,
22757  PORTS_CHANNEL channel,
22758  PORTS_BIT_POS bitPos )
22759  Summary:
22760  Sets the selected digital pin/latch.
22761  <p><b>Implementation:</b> Dynamic</p>
22762  Description:
22763  This function sets the selected digital pin/latch.
22764  Preconditions:
22765  None.
22766  Parameters:
22767  index - Identifier for the device instance to be configured
22768  channel - Identifier for the PORT channel: A, B, C, etc.
22769  bitPos - Possible values of PORTS_BIT_POS
22770  Returns:
22771  None.
22772  Example:
22773  <code>
22774  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22775  // application developer.
22776  // MY_PINNUM - PORTS_PIN_10
22777  SYS_PORTS_PinSet(MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM);
22778  </code>
22779  Remarks:
22780  Not all features are available on all devices. Refer to the specific device
22781  data sheet for availability.
22782 */
22783 
22784 void
22786  PORTS_MODULE_ID index ,
22787  PORTS_CHANNEL channel ,
22788  PORTS_BIT_POS bitPos ) ;
22789 // *****************************************************************************
22790 /* Function:
22791  void SYS_PORTS_PinClear ( PORTS_MODULE_ID index,
22792  PORTS_CHANNEL channel,
22793  PORTS_BIT_POS bitPos )
22794  Summary:
22795  Clears the selected digital pin.
22796  <p><b>Implementation:</b> Dynamic</p>
22797  Description:
22798  This function clears the selected digital pin.
22799  Preconditions:
22800  None.
22801  Parameters:
22802  index - Identifier for the device instance to be configured
22803  channel - Identifier for the PORT channel: A, B, C, etc.
22804  bitPos - Possible values of PORTS_BIT_POS
22805  Returns:
22806  None.
22807  Example:
22808  <code>
22809  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22810  // application developer.
22811  // MY_PINNUM - PORTS_IO_PIN_10
22812  SYS_PORTS_PinClear( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22813  </code>
22814  Remarks:
22815  Not all features are available on all devices. Refer to the specific device
22816  data sheet for availability.
22817 */
22818 
22819 void
22821  PORTS_MODULE_ID index ,
22822  PORTS_CHANNEL channel ,
22823  PORTS_BIT_POS bitPos ) ;
22824 // *****************************************************************************
22825 /* Function:
22826  void SYS_PORTS_PinDirectionSelect ( PORTS_MODULE_ID index,
22827  SYS_PORTS_PIN_DIRECTION pinDir,
22828  PORTS_CHANNEL channel,
22829  PORTS_BIT_POS bitPos )
22830  Summary:
22831  Enables the direction for the selected pin.
22832  <p><b>Implementation:</b> Dynamic</p>
22833  Description:
22834  This function enables the direction for the selected pin.
22835  Preconditions:
22836  None.
22837  Parameters:
22838  index - Identifier for the device instance to be configured
22839  pinDir - Pin direction
22840  channel - Identifier for the PORT channel: A, B, C, etc.
22841  bitPos - Possible values of PORTS_BIT_POS
22842  Returns:
22843  None.
22844  Example:
22845  <code>
22846  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22847  // application developer.
22848  // MY_PINNUM - PORTS_PIN_10
22849  SYS_PORTS_PIN_DIRECTION pinDir;
22850  pinDir = SYS_PORTS_DIRECTION_INPUT;
22851  SYS_PORTS_PinDirectionSelect(MY_PORTS_INSTANCE, pinDir, MY_CHANNEL, MY_PINNUM);
22852  </code>
22853  Remarks:
22854  Not all features are available on all devices. Refer to the specific device
22855  data sheet for availability.
22856 */
22857 
22858 void
22860  PORTS_MODULE_ID index ,
22861  SYS_PORTS_PIN_DIRECTION pinDir ,
22862  PORTS_CHANNEL channel ,
22863  PORTS_BIT_POS bitPos ) ;
22864 // *****************************************************************************
22865 /* Function:
22866  void SYS_PORTS_PinOpenDrainEnable ( PORTS_MODULE_ID index,
22867  PORTS_CHANNEL channel,
22868  PORTS_BIT_POS bitPos )
22869  Summary:
22870  Enables the open-drain functionality for the selected pin.
22871  <p><b>Implementation:</b> Dynamic</p>
22872  Description:
22873  This function enables the open-drain functionality for the selected pin.
22874  Preconditions:
22875  None.
22876  Parameters:
22877  index - Identifier for the device instance to be configured
22878  channel - Identifier for the PORT channel: A, B, C, etc.
22879  bitPos - Possible values of PORTS_BIT_POS
22880  Returns:
22881  None.
22882  Example:
22883  <code>
22884  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22885  // application developer.
22886  // MY_PINNUM - PORTS_PIN_10
22887  SYS_PORTS_PinOpenDrainEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22888  </code>
22889  Remarks:
22890  Not all features are available on all devices. Refer to the specific device
22891  data sheet for availability.
22892 */
22893 
22894 void
22896  PORTS_MODULE_ID index ,
22897  PORTS_CHANNEL channel ,
22898  PORTS_BIT_POS bitPos ) ;
22899 // *****************************************************************************
22900 /* Function:
22901  void SYS_PORTS_PinOpenDrainDisable ( PORTS_MODULE_ID index,
22902  PORTS_CHANNEL channel,
22903  PORTS_BIT_POS bitPos )
22904  Summary:
22905  Disables the open-drain functionality for the selected pin.
22906  <p><b>Implementation:</b> Dynamic</p>
22907  Description:
22908  This function disables the open-drain functionality for the selected pin.
22909  Preconditions:
22910  None.
22911  Parameters:
22912  index - Identifier for the device instance to be configured
22913  channel - Identifier for the PORT channel: A, B, C, etc.
22914  bitPos - Possible values of PORTS_BIT_POS
22915  Returns:
22916  None.
22917  Example:
22918  <code>
22919  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22920  // application developer.
22921  // MY_PINNUM - PORTS_PIN_10
22922  SYS_PORTS_PinOpenDrainDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22923  </code>
22924  Remarks:
22925  Not all features are available on all devices. Refer to the specific device
22926  data sheet for availability.
22927 */
22928 
22929 void
22931  PORTS_MODULE_ID index ,
22932  PORTS_CHANNEL channel ,
22933  PORTS_BIT_POS bitPos ) ;
22934 // *****************************************************************************
22935 /* Function:
22936  void SYS_PORTS_PinPullUpEnable ( PORTS_MODULE_ID index,
22937  PORTS_CHANNEL channel,
22938  PORTS_BIT_POS bitPos )
22939  Summary:
22940  Enables the pull-up functionality for the selected pin.
22941  <p><b>Implementation:</b> Dynamic</p>
22942  Description:
22943  This function enables the pull-up functionality for the selected pin.
22944  Preconditions:
22945  None.
22946  Parameters:
22947  index - Identifier for the device instance to be configured
22948  channel - Identifier for the PORT channel: A, B, C, etc.
22949  bitPos - Possible values of PORTS_BIT_POS
22950  Returns:
22951  None.
22952  Example:
22953  <code>
22954  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22955  // application developer.
22956  // MY_PINNUM - PORTS_PIN_10
22957  SYS_PORTS_PinPullUpEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
22958  </code>
22959  Remarks:
22960  Not all features are available on all devices. Refer to the specific device
22961  data sheet for availability.
22962 */
22963 
22964 void
22966  PORTS_MODULE_ID index ,
22967  PORTS_CHANNEL channel ,
22968  PORTS_BIT_POS bitPos ) ;
22969 // *****************************************************************************
22970 /* Function:
22971  void SYS_PORTS_PinPullUpDisable ( PORTS_MODULE_ID index,
22972  PORTS_CHANNEL channel,
22973  PORTS_BIT_POS bitPos )
22974  Summary:
22975  Disables the pull-up functionality for the selected pin.
22976  <p><b>Implementation:</b> Dynamic</p>
22977  Description:
22978  This function disables the pull-up functionality for the selected pin.
22979  Preconditions:
22980  None.
22981  Parameters:
22982  index - Identifier for the device instance to be configured
22983  channel - Identifier for the PORT channel: A, B, C, etc.
22984  bitPos - Possible values of PORTS_BIT_POS
22985  Returns:
22986  None.
22987  Example:
22988  <code>
22989  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
22990  // application developer.
22991  // MY_PINNUM - PORTS_PIN_10
22992  SYS_PORTS_PinPullUpDisable(MY_PORTS_INSTANCE, MY_PINNUM);
22993  </code>
22994  Remarks:
22995  Not all features are available on all devices. Refer to the specific device
22996  data sheet for availability.
22997 */
22998 
22999 void
23001  PORTS_MODULE_ID index ,
23002  PORTS_CHANNEL channel ,
23003  PORTS_BIT_POS bitPos ) ;
23004 // *****************************************************************************
23005 /* Function:
23006  void SYS_PORTS_PinPullDownEnable ( PORTS_MODULE_ID index,
23007  PORTS_CHANNEL channel,
23008  PORTS_BIT_POS bitPos )
23009  Summary:
23010  Enables the pull-down functionality for the selected pin.
23011  <p><b>Implementation:</b> Dynamic</p>
23012  Description:
23013  This function enables the pull-down functionality for the selected pin.
23014  Preconditions:
23015  None.
23016  Parameters:
23017  index - Identifier for the device instance to be configured
23018  channel - Identifier for the PORT channel: A, B, C, etc.
23019  bitPos - Possible values of PORTS_BIT_POS
23020  Returns:
23021  None.
23022  Example:
23023  <code>
23024  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23025  // application developer.
23026  // MY_PINNUM - PORTS_PIN_10
23027  SYS_PORTS_PinPullDownEnable( MY_PORTS_INSTANCE, MY_CHANNEL, MY_PINNUM );
23028  </code>
23029  Remarks:
23030  Not all features are available on all devices. Refer to the specific device
23031  data sheet for availability.
23032 */
23033 
23034 void
23036  PORTS_MODULE_ID index ,
23037  PORTS_CHANNEL channel ,
23038  PORTS_BIT_POS bitPos ) ;
23039 // *****************************************************************************
23040 /* Function:
23041  void SYS_PORTS_PinPullDownDisable ( PORTS_MODULE_ID index,
23042  PORTS_CHANNEL channel,
23043  PORTS_BIT_POS bitPos )
23044  Summary:
23045  Disables the pull-down functionality for the selected pin.
23046  <p><b>Implementation:</b> Dynamic</p>
23047  Description:
23048  This function disables the pull-down functionality for the selected pin.
23049  Preconditions:
23050  None.
23051  Parameters:
23052  index - Identifier for the device instance to be configured
23053  channel - Identifier for the PORT channel: A, B, C, etc.
23054  bitPos - Possible values of PORTS_BIT_POS
23055  Returns:
23056  None.
23057  Example:
23058  <code>
23059  // Where MY_PORTS_INSTANCE, is the ports instance selected for use by the
23060  // application developer.
23061  // MY_PINNUM - PORTS_PIN_10
23062  SYS_PORTS_PinPullDownDisable(MY_PORTS_INSTANCE, MY_PINNUM);
23063  </code>
23064  Remarks:
23065  Not all features are available on all devices. Refer to the specific device
23066  data sheet for availability.
23067 */
23068 
23069 void
23071  PORTS_MODULE_ID index ,
23072  PORTS_CHANNEL channel ,
23073  PORTS_BIT_POS bitPos ) ;
23074 //******************************************************************************
23075 /* Function:
23076  void SYS_PORTS_InterruptEnable
23077  (
23078  PORTS_MODULE_ID index,
23079  PORTS_CHANNEL channel,
23080  PORTS_BIT_POS bitPos,
23081  PORTS_PIN_INTERRUPT_TYPE pinInterruptType
23082  )
23083  Summary:
23084  Enables the selected interrupt for the selected port pin.
23085  Description:
23086  This function enables the selected interrupt for the selected port pin.
23087  Preconditions:
23088  Select the pull-up or pull-down as required.
23089  Parameters:
23090  index - Identifier for the device instance to be configured
23091  channel - Identifier for the PORT channel: A, B, C, etc.
23092  bitPos - Possible values of PORTS_BIT_POS
23093  pinInterruptType - Interrupt type from PORTS_PIN_INTERRUPT_TYPE set
23094  Returns:
23095  None.
23096  Example:
23097  <code>
23098  SYS_PORTS_InterruptEnable(MY_PORTS_INSTANCE, MY_PORTS_CHANNEL, MY_PORT_BIT_POS, PORTS_PIN_INTERRUPT_BOTH_EDGE );
23099  </code>
23100  Remarks:
23101  None.
23102 */
23103 
23104 void
23106  PORTS_MODULE_ID index ,
23107  PORTS_CHANNEL channel ,
23108  PORTS_BIT_POS bitPos ,
23109  PORTS_PIN_INTERRUPT_TYPE pinInterruptType ) ;
23110 //DOM-IGNORE-BEGIN
23111 //DOM-IGNORE-END
23112  //SYS_PORTS_H
23113 /*******************************************************************************
23114  End of File
23115 */
23116 
23117 #endif /*00 C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h*/
23118 /* CLOSE_FILE Include File */
23119 
23120 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h */
23121 /*******************************************************************************
23122  SPI Driver Interface
23123  Company:
23124  Microchip Technology Inc.
23125  File Name:
23126  drv_spi.h
23127  Summary:
23128  SPI device driver interface file.
23129  Description:
23130  The SPI driver provides a simple interface to manage the SPI module.
23131  This file defines the interface definitions and prototypes for the SPI driver.
23132 *******************************************************************************/
23133 //DOM-IGNORE-BEGIN
23134 /*******************************************************************************
23135 Copyright (c) 2013-2014 released Microchip Technology Inc. All rights reserved.
23136 Microchip licenses to you the right to use, modify, copy and distribute
23137 Software only when embedded on a Microchip microcontroller or digital signal
23138 controller that is integrated into your product or third party product
23139 (pursuant to the sublicense terms in the accompanying license agreement).
23140 You should refer to the license agreement accompanying this Software for
23141 additional information regarding your rights and obligations.
23142 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23143 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23144 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23145 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23146 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23147 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23148 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23149 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23150 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23151 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23152 *******************************************************************************/
23153 //DOM-IGNORE-END
23154 #ifndef _DRV_SPI_H
23155 #define _DRV_SPI_H
23156 /* OPEN FILE C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h */
23157 /*******************************************************************************
23158  SPI Driver Interface
23159  Company:
23160  Microchip Technology Inc.
23161  File Name:
23162  drv_spi_definitions.h
23163  Summary:
23164  SPI device driver interface file.
23165  Description:
23166  The SPI driver provides a simple interface to manage the SPI module.
23167  This file defines the interface definitions and prototypes for the SPI
23168  driver.
23169 *******************************************************************************/
23170 //DOM-IGNORE-BEGIN
23171 /*******************************************************************************
23172 Copyright (c) 2016 released Microchip Technology Inc. All rights reserved.
23173 Microchip licenses to you the right to use, modify, copy and distribute
23174 Software only when embedded on a Microchip microcontroller or digital signal
23175 controller that is integrated into your product or third party product
23176 (pursuant to the sublicense terms in the accompanying license agreement).
23177 You should refer to the license agreement accompanying this Software for
23178 additional information regarding your rights and obligations.
23179 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23180 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23181 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23182 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23183 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23184 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23185 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23186 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23187 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23188 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23189 *******************************************************************************/
23190 //DOM-IGNORE-END
23191 #ifndef _DRV_SPI_DEFINITIONS_H
23192 #define _DRV_SPI_DEFINITIONS_H
23193 // *****************************************************************************
23194 // *****************************************************************************
23195 // Section: Data Types
23196 // *****************************************************************************
23197 // *****************************************************************************
23198 #include <stdint.h>
23199 #include <stdbool.h>
23200 #include "C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_config.h" /* LDRA full path */
23201 #include "C:\microchip\harmony\v2_06\framework\driver\driver_common.h" // Common Driver Definitions /* LDRA full path */
23202 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h */
23203 /*******************************************************************************
23204  SPI Peripheral Library Interface Header
23205  Company:
23206  Microchip Technology Inc.
23207  File Name:
23208  plib_spi.h
23209  Summary:
23210  SPI Peripheral Library Interface Header for common definitions.
23211  Description:
23212  This header file contains the function prototypes and definitions of
23213  the data types and constants that make up the interface to the SPI
23214  PLIB.
23215  *******************************************************************************/
23216 // DOM-IGNORE-BEGIN
23217 /*******************************************************************************
23218 Copyright 2013-2015 released Microchip Technology Inc. All rights reserved.
23219 Microchip licenses to you the right to use, modify, copy and distribute
23220 Software only when embedded on a Microchip microcontroller or digital signal
23221 controller that is integrated into your product or third party product
23222 (pursuant to the sublicense terms in the accompanying license agreement).
23223 You should refer to the license agreement accompanying this Software for
23224 additional information regarding your rights and obligations.
23225 SOFTWARE AND DOCUMENTATION ARE PROVIDED AS IS WITHOUT WARRANTY OF ANY KIND,
23226 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23227 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23228 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23229 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23230 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23231 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23232 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23233 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23234 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23235  *******************************************************************************/
23236 // DOM-IGNORE-END
23237 #ifndef _PLIB_SPI_H
23238 #define _PLIB_SPI_H
23239 // DOM-IGNORE-BEGIN
23240 // DOM-IGNORE-END
23241 // *****************************************************************************
23242 // *****************************************************************************
23243 // Section: Included Files (continued at end of file)
23244 // *****************************************************************************
23245 // *****************************************************************************
23246 /* This section lists the other files that are included in this file. However,
23247  please see the end of the file for additional implementation header files
23248  that are also included.
23249  */
23250 /* OPEN FILE C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h */
23251 //DOM-IGNORE-BEGIN
23252 /*******************************************************************************
23253 Copyright (c) 2011-2016 released Microchip Technology Inc. All rights reserved.
23254 Microchip licenses to you the right to use, modify, copy and distribute
23255 Software only when embedded on a Microchip microcontroller or digital signal
23256 controller that is integrated into your product or third party product
23257 (pursuant to the sublicense terms in the accompanying license agreement).
23258 You should refer to the license agreement accompanying this Software for
23259 additional information regarding your rights and obligations.
23260 SOFTWARE AND DOCUMENTATION ARE PROVIDED 'AS IS' WITHOUT WARRANTY OF ANY KIND,
23261 EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF
23262 MERCHANTABILITY, TITLE, NON-INFRINGEMENT AND FITNESS FOR A PARTICULAR PURPOSE.
23263 IN NO EVENT SHALL MICROCHIP OR ITS LICENSORS BE LIABLE OR OBLIGATED UNDER
23264 CONTRACT, NEGLIGENCE, STRICT LIABILITY, CONTRIBUTION, BREACH OF WARRANTY, OR
23265 OTHER LEGAL EQUITABLE THEORY ANY DIRECT OR INDIRECT DAMAGES OR EXPENSES
23266 INCLUDING BUT NOT LIMITED TO ANY INCIDENTAL, SPECIAL, INDIRECT, PUNITIVE OR
23267 CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF PROCUREMENT OF
23268 SUBSTITUTE GOODS, TECHNOLOGY, SERVICES, OR ANY CLAIMS BY THIRD PARTIES
23269 (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), OR OTHER SIMILAR COSTS.
23270  *******************************************************************************/
23271 //DOM-IGNORE-END
23272 #ifndef _PLIB_SPI_PROCESSOR_H
23273 #define _PLIB_SPI_PROCESSOR_H
23274 #error "Can't find header"
23275 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\processor\spi_processor.h*/
23276 /* CLOSE_FILE Include File */
23277 
23278 // *****************************************************************************
23279 // *****************************************************************************
23280 // Section: Constants & Data Types
23281 // *****************************************************************************
23282 // *****************************************************************************
23283 // *****************************************************************************
23284 // *****************************************************************************
23285 // Section: SPI Peripheral Library Interface Routines
23286 // *****************************************************************************
23287 // *****************************************************************************
23288 //******************************************************************************
23289 /* Function:
23290  void PLIB_SPI_Enable( SPI_MODULE_ID index )
23291  Summary:
23292  Enables the SPI module.
23293  Description:
23294  This function enables the SPI module.
23295  This operation is atomic.
23296  Precondition:
23297  None.
23298  Parameters:
23299  index - Identifier for the device instance to be configured
23300  Returns:
23301  None.
23302  Example:
23303  <code>
23304  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23305  // application developer.
23306  PLIB_SPI_Enable(MY_SPI_INSTANCE);
23307  </code>
23308  Remarks:
23309  The SCKx, SDOx, SDIx and SSx pins must be assigned to available RPn pins
23310  before use.
23311  This function implements an operation of the enable control feature. This
23312  feature may not be available on all devices. Please refer to the specific
23313  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23314  in your application to automatically determine whether this feature is available.
23315  */
23316 
23317 void
23318  PLIB_SPI_Enable (
23319  SPI_MODULE_ID index ) ;
23320 //******************************************************************************
23321 /* Function:
23322  void PLIB_SPI_Disable (SPI_MODULE_ID index)
23323  Summary:
23324  Disables the SPI module.
23325  Description:
23326  This function disables the SPI module.
23327  This operation is atomic.
23328  Precondition:
23329  None.
23330  Parameters:
23331  index - Identifier for the device instance to be configured
23332  Returns:
23333  None.
23334  Example:
23335  <code>
23336  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23337  // application developer.
23338  PLIB_SPI_Disable(MY_SPI_INSTANCE);
23339  </code>
23340  Remarks:
23341  This function implements an operation of the enable control feature. This
23342  feature may not be available on all devices. Please refer to the specific
23343  device data sheet to determine availability or use "PLIB_SPI_ExistsEnableControl"
23344  in your application to automatically determine whether this feature is available.
23345  */
23346 
23347 void
23349  SPI_MODULE_ID index ) ;
23350 //******************************************************************************
23351 /* Function:
23352  void PLIB_SPI_StopInIdleEnable (SPI_MODULE_ID index)
23353  Summary:
23354  Discontinues module operation when the device enters Idle mode.
23355  Description:
23356  This function sets up the SPI module such that module operation is disabled
23357  when the device enters Idle mode.
23358  This operation is atomic.
23359  Precondition:
23360  None.
23361  Parameters:
23362  index - Identifier for the device instance to be configured
23363  Returns:
23364  None.
23365  Example:
23366  <code>
23367  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23368  // application developer.
23369  PLIB_SPI_StopInIdleEnable(MY_SPI_INSTANCE);
23370  </code>
23371  Remarks:
23372  This function implements an operation of the stop in idle control feature.
23373  This feature may not be available on all devices. Please refer to the
23374  specific device data sheet to determine availability or use
23375  "PLIB_SPI_ExistsStopInIdleControl" in your application to automatically
23376  determine if this feature is available.
23377  */
23378 
23379 void
23381  SPI_MODULE_ID index ) ;
23382 //******************************************************************************
23383 /* Function:
23384  void PLIB_SPI_StopInIdleDisable (SPI_MODULE_ID index)
23385  Summary:
23386  Continues module operation when the device enters Idle mode.
23387  Description:
23388  This function sets up the SPI module such that module operation is continued
23389  when the device enters Idle mode.
23390  This operation is atomic.
23391  Precondition:
23392  None.
23393  Parameters:
23394  index - Identifier for the device instance to be configured
23395  Returns:
23396  None.
23397  Example:
23398  <code>
23399  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23400  // application developer.
23401  PLIB_SPI_StopInIdleDisable(MY_SPI_INSTANCE);
23402  </code>
23403  Remarks:
23404  This function implements an operation of the stop in idle control feature.
23405  This feature may not be available on all devices. Please refer to the
23406  specific device data sheet to determine availability or use
23407  "PLIB_SPI_ExistsStopInIdleControl" in your application to determine whether
23408  this feature is available.
23409  */
23410 
23411 void
23413  SPI_MODULE_ID index ) ;
23414 //******************************************************************************
23415 /* Function:
23416  bool PLIB_SPI_ReceiverHasOverflowed (SPI_MODULE_ID index)
23417  Summary:
23418  Returns the current status of the SPI receiver overflow.
23419  Description:
23420  This function returns the current status of the SPI receiver overflow.
23421  This operation is atomic.
23422  Precondition:
23423  None.
23424  Parameters:
23425  index - Identifier for the device instance to be configured
23426  Returns:
23427  SPI receiver overflow status:
23428  - true - A new byte/word is completely received and discarded.
23429  The user software has not read the previous data in
23430  the SPI buffer register.
23431  - false - No Overflow has occurred
23432  Example:
23433  <code>
23434  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23435  // application developer.
23436  bool overflowstate = PLIB_SPI_ReceiverHasOverflowed(MY_SPI_INSTANCE);
23437  </code>
23438  Remarks:
23439  This function implements an operation of the receiver overflow status feature.
23440  This feature may not be available on all devices. Please refer to the
23441  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23442  in your application to automatically determine whether this feature is available.
23443  */
23444 
23445 bool
23447  SPI_MODULE_ID index ) ;
23448 //******************************************************************************
23449 /* Function:
23450  void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
23451  Summary:
23452  Clears the SPI receive overflow flag.
23453  Description:
23454  This function clears the SPI receive overflow flag.
23455  This operation is atomic.
23456  Precondition:
23457  None.
23458  Parameters:
23459  index - Identifier for the device instance to be configured
23460  Returns:
23461  None.
23462  Example:
23463  <code>
23464  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23465  // application developer.
23466  PLIB_SPI_ReceiverOverflowClear(MY_SPI_INSTANCE);
23467  </code>
23468  Remarks:
23469  This function implements an operation of the receiver overflow status feature.
23470  This feature may not be available on all devices. Please refer to the
23471  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiverOverflow"
23472  in your application to automatically determine whether this feature is available.
23473  */
23474 
23475 void
23477  SPI_MODULE_ID index ) ;
23478 //******************************************************************************
23479 /* Function:
23480  bool PLIB_SPI_TransmitBufferIsFull (SPI_MODULE_ID index)
23481  Summary:
23482  Returns the current transmit buffer status of the SPI module.
23483  Description:
23484  This function returns the current transmit buffer status of the SPI module.
23485  This operation is atomic.
23486  Precondition:
23487  None.
23488  Parameters:
23489  index - Identifier for the device instance to be configured
23490  Returns:
23491  - true - Transmit not yet started, transmit buffer is full
23492  - false - Transmit started, transmit buffer is empty/not full
23493  Example:
23494  <code>
23495  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23496  // application developer.
23497  bool buffullstate = PLIB_SPI_TransmitBufferIsFull (MY_SPI_INSTANCE);
23498  </code>
23499  Remarks:
23500  In Standard Buffer mode - automatically set in hardware when SPI buffer writes
23501  occur, loading the transmit buffer. Automatically cleared in hardware when
23502  the SPI module transfers data from the transmit buffer to the shift register.
23503  In Enhanced Buffer mode - automatically set in hardware when SPI buffer writes
23504  occur, loading the last available buffer. Automatically cleared in hardware
23505  when the buffer is available for writing.
23506  This function implements an operation of the transmit buffer status feature.
23507  This feature may not be available on all devices. Please refer to the
23508  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferFullStatus"
23509  in your application to automatically determine whether this feature is available.
23510  */
23511 
23512 bool
23514  SPI_MODULE_ID index ) ;
23515 //******************************************************************************
23516 /* Function:
23517  bool PLIB_SPI_ReceiverBufferIsFull (SPI_MODULE_ID index)
23518  Summary:
23519  Returns the current status of the SPI receive buffer.
23520  Description:
23521  This function returns the current status of the SPI receive buffer.
23522  This operation is atomic.
23523  Precondition:
23524  None.
23525  Parameters:
23526  index - Identifier for the device instance to be configured
23527  Returns:
23528  Receiver Buffer Full Status:
23529  - true - Receive complete, receive buffer is full
23530  - false - Receive is not complete, receive buffer is empty
23531  Example:
23532  <code>
23533  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23534  // application developer.
23535  bool receivefullstate = PLIB_SPI_ReceiverBufferIsFull (MY_SPI_INSTANCE);
23536  </code>
23537  Remarks:
23538  In Standard Buffer mode - automatically set in hardware when the SPI module
23539  transfers data from the shift register to the receive buffer. Automatically
23540  cleared in hardware when the core reads the SPI buffer, read in the receive buffer.
23541  In Enhanced Buffer mode - automatically set in hardware when the SPI module
23542  transfers data from the shift register to the receive buffer, filling the
23543  last unread buffer. Automatically cleared in hardware when a buffer is available
23544  for a transfer from the shift register.
23545  This function implements an operation of the receiver buffer status feature.
23546  This feature may not be available on all devices. Please refer to the
23547  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveBufferStatus"
23548  in your application to automatically determine whether this feature is available.
23549  */
23550 
23551 bool
23553  SPI_MODULE_ID index ) ;
23554 //******************************************************************************
23555 /* Function:
23556  void PLIB_SPI_PinEnable (SPI_MODULE_ID index,SPI_PIN pin)
23557  Summary:
23558  Enables the selected SPI pins.
23559  Description:
23560  This function enables the selected SPI pins.
23561  Precondition:
23562  None.
23563  Parameters:
23564  index - Identifier for the device instance to be configured
23565  pin - One of the SPI_PIN enumeration values as the SPI pin
23566  Returns:
23567  None.
23568  Example:
23569  <code>
23570  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23571  // application developer.
23572  PLIB_SPI_PinEnable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23573  </code>
23574  Remarks:
23575  This function implements an operation of the pin control feature.
23576  This feature may not be available on all devices. Please refer to the
23577  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23578  in your application to automatically determine whether this feature is available.
23579  */
23580 
23581 void
23583  SPI_MODULE_ID index ,
23584  SPI_PIN pin ) ;
23585 //******************************************************************************
23586 /* Function:
23587  void PLIB_SPI_PinDisable (SPI_MODULE_ID index, SPI_PIN pin)
23588  Summary:
23589  Enables the selected SPI pins.
23590  Description:
23591  This function enables the selected SPI pins.
23592  Precondition:
23593  None.
23594  Parameters:
23595  index - Identifier for the device instance to be configured
23596  pin - One of the SPI_PIN enumeration values as the SPI pin
23597  Returns:
23598  None.
23599  Example:
23600  <code>
23601  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23602  // application developer.
23603  PLIB_SPI_PinDisable(MY_SPI_INSTANCE, SPI_PIN_SLAVE_SELECT);
23604  </code>
23605  Remarks:
23606  This function implements an operation of the pin control feature.
23607  This feature may not be available on all devices. Please refer to the
23608  specific device data sheet to determine availability or use "PLIB_SPI_ExistsPinControl"
23609  in your application to automatically determine whether this feature is available.
23610  */
23611 
23612 void
23614  SPI_MODULE_ID index ,
23615  SPI_PIN pin ) ;
23616 //******************************************************************************
23617 /* Function:
23618  void PLIB_SPI_CommunicationWidthSelect (SPI_MODULE_ID index,
23619  SPI_COMMUNICATION_WIDTH width )
23620  Summary:
23621  Selects the data width for the SPI communication.
23622  Description:
23623  This function selects the data width for the SPI communication.
23624  This operation is atomic.
23625  Precondition:
23626  None.
23627  Parameters:
23628  index - Identifier for the device instance to be configured
23629  width - One of the SPI_COMMUNICATION_WIDTH enumeration values as the
23630  SPI buffer width
23631  Returns:
23632  None.
23633  Example:
23634  <code>
23635  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23636  // application developer.
23637  PLIB_SPI_CommunicationWidthSelect(MY_SPI_INSTANCE, SPI_COMMUNICATION_WIDTH_8BITS);
23638  </code>
23639  Remarks:
23640  This function implements an operation of the communication width feature.
23641  This feature may not be available on all devices. Please refer to the
23642  specific device data sheet to determine availability or use "PLIB_SPI_ExistsCommunicationWidth"
23643  in your application to automatically determine whether this feature is available.
23644  */
23645 
23646 void
23648  SPI_MODULE_ID index ,
23649  SPI_COMMUNICATION_WIDTH width ) ;
23650 //******************************************************************************
23651 /* Function:
23652  void PLIB_SPI_AudioCommunicationWidthSelect (SPI_MODULE_ID index,
23653  SPI_AUDIO_COMMUNICATION_WIDTH width )
23654  Summary:
23655  Selects the data width for the SPI audio communication.
23656  Description:
23657  This function selects the data width for the SPI audio communication.
23658  This operation is atomic.
23659  Precondition:
23660  None.
23661  Parameters:
23662  index - Identifier for the device instance to be configured
23663  width - One of the SPI_AUDIO_COMMUNICATION_WIDTH enumeration values as the
23664  SPI buffer width
23665  Returns:
23666  None.
23667  Example:
23668  <code>
23669  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23670  // application developer.
23671  PLIB_SPI_AudioCommunicationWidthSelect(MY_SPI_INSTANCE,
23672  SPI_AUDIO_COMMUNICATION_32DATA_32FIFO_32CHANNEL);
23673  </code>
23674  Remarks:
23675  This mode is available only when PLIB_SPI_AudioProtocolEnable is enabled.
23676  This function implements an operation of the audio communication width feature.
23677  This feature may not be available on all devices. Please refer to the
23678  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioCommunicationWidth"
23679  in your application to automatically determine whether this feature is available.
23680  */
23681 
23682 void
23684  SPI_MODULE_ID index ,
23685  SPI_AUDIO_COMMUNICATION_WIDTH mode ) ;
23686 //******************************************************************************
23687 /* Function:
23688  void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index,
23689  SPI_INPUT_SAMPLING_PHASE phase)
23690  Summary:
23691  Selects the SPI data input sample phase.
23692  Description:
23693  This function selects the input sampling phase in Master mode.
23694  Precondition:
23695  None.
23696  Parameters:
23697  index - Identifier for the device instance to be configured
23698  phase - One of the SPI_INPUT_SAMPLING_PHASE as the SPI input
23699  sampling phase
23700  Returns:
23701  None.
23702  Example:
23703  <code>
23704  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23705  // application developer.
23706  PLIB_SPI_InputSamplePhaseSelect(MY_SPI_INSTANCE, SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE);
23707  </code>
23708  Remarks:
23709  This function implements an operation of the input sample phase feature.
23710  This feature may not be available on all devices. Please refer to the
23711  specific device data sheet to determine availability or use "PLIB_SPI_ExistsInputSamplePhase"
23712  in your application to automatically determine whether this feature is available.
23713  */
23714 
23715 void
23717  SPI_MODULE_ID index ,
23718  SPI_INPUT_SAMPLING_PHASE phase ) ;
23719 //******************************************************************************
23720 /* Function:
23721  void PLIB_SPI_OutputDataPhaseSelect (SPI_MODULE_ID index,
23722  SPI_OUTPUT_DATA_PHASE data)
23723  Summary:
23724  Selects serial output data change.
23725  Description:
23726  This function selects serial output data change.
23727  Precondition:
23728  None.
23729  Parameters:
23730  index - Identifier for the device instance to be configured
23731  data - One of the SPI_OUTPUT_DATA_PHASE enumeration values as the
23732  SPI serial output data change
23733  Returns:
23734  None.
23735  Example:
23736  <code>
23737  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23738  // application developer.
23739  PLIB_SPI_OutputDataPhaseSelect(MY_SPI_INSTANCE, SPI_OUTPUT_DATA_PHASE_ON_ACTIVE_TO_IDLE_CLOCK);
23740  </code>
23741  Remarks:
23742  This function implements an operation of the output data phase feature.
23743  This feature may not be available on all devices. Please refer to the
23744  specific device data sheet to determine availability or use "PLIB_SPI_ExistsOutputDataPhase"
23745  in your application to automatically determine whether this feature is available.
23746  */
23747 
23748 void
23750  SPI_MODULE_ID index ,
23751  SPI_OUTPUT_DATA_PHASE phase ) ;
23752 //******************************************************************************
23753 /* Function:
23754  void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index,
23755  SPI_CLOCK_POLARITY polarity)
23756  Summary:
23757  Enables clock polarity.
23758  Description:
23759  This function enables clock polarity.
23760  Precondition:
23761  None.
23762  Parameters:
23763  index - Identifier for the device instance to be configured
23764  polarity - One of the SPI_CLOCK_POLARITY enumeration values as the SPI clock polarity
23765  Returns:
23766  None.
23767  Example:
23768  <code>
23769  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23770  // application developer.
23771  PLIB_SPI_ClockPolaritySelect(MY_SPI_INSTANCE, SPI_CLOCK_POLARITY_IDLE_HIGH );
23772  </code>
23773  Remarks:
23774  This function implements an operation of the clock polarity feature.
23775  This feature may not be available on all devices. Please refer to the
23776  specific device data sheet to determine availability or use "PLIB_SPI_ExistsClockPolarity"
23777  in your application to automatically determine whether this feature is available.
23778  */
23779 
23780 void
23782  SPI_MODULE_ID index ,
23783  SPI_CLOCK_POLARITY polarity ) ;
23784 //******************************************************************************
23785 /* Function:
23786  void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
23787  Summary:
23788  Enables the SPI in Master mode.
23789  Description:
23790  This function enables the SPI in Master mode.
23791  This operation is atomic.
23792  Precondition:
23793  None.
23794  Parameters:
23795  index - Identifier for the device instance to be configured
23796  Returns:
23797  None.
23798  Example:
23799  <code>
23800  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23801  // application developer.
23802  PLIB_SPI_MasterEnable(MY_SPI_INSTANCE);
23803  </code>
23804  Remarks:
23805  This function implements an operation of the master enable control feature.
23806  This feature may not be available on all devices. Please refer to the
23807  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23808  in your application to automatically determine whether this feature is available.
23809  */
23810 
23811 void
23813  SPI_MODULE_ID index ) ;
23814 //******************************************************************************
23815 /* Function:
23816  void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
23817  Summary:
23818  Enables the SPI in Slave mode.
23819  Description:
23820  This function enables the SPI in Slave mode.
23821  This operation is atomic.
23822  Precondition:
23823  None.
23824  Parameters:
23825  index - Identifier for the device instance to be configured
23826  Returns:
23827  None.
23828  Example:
23829  <code>
23830  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23831  // application developer.
23832  PLIB_SPI_SlaveEnable(MY_SPI_INSTANCE);
23833  </code>
23834  Remarks:
23835  This function implements an operation of the master enable control feature.
23836  This feature may not be available on all devices. Please refer to the
23837  specific device data sheet to determine availability or use "PLIB_SPI_ExistsMasterControl"
23838  in your application to automatically determine whether this feature is available.
23839  */
23840 
23841 void
23843  SPI_MODULE_ID index ) ;
23844 //******************************************************************************
23845 /* Function:
23846  void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency,
23847  uint32_t baudRate )
23848  Summary:
23849  Sets the baud rate to the desired value.
23850  Description:
23851  This function sets the baud rate to the desired value.
23852  Precondition:
23853  None.
23854  Parameters:
23855  index - Identifier for the device instance to be configured
23856  clockFrequency - Clock frequency
23857  baudrate - Baud rate value
23858  Returns:
23859  None.
23860  Example:
23861  <code>
23862  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23863  // application developer.
23864  PLIB_SPI_BaudRateSet(MY_SPI_INSTANCE, MY_CLOCK_FREQUENCY, 9600);
23865  </code>
23866  Remarks:
23867  Setting a new baud rate value causes the baud rate timer to reset.
23868  This ensures that the baud rate timer does not have to overflow before
23869  outputting the new baud rate.
23870  If the system clock is changed during an active receive operation, a
23871  receive error or data loss may result. To avoid this issue, verify that
23872  no receptions are in progress before changing the system clock.
23873  This function implements an operation of the baud rate set feature.
23874  This feature may not be available on all devices. Please refer to the
23875  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRate"
23876  in your application to automatically determine whether this feature is available.
23877  */
23878 
23879 void
23881  SPI_MODULE_ID index ,
23882  uint32_t clockFrequency ,
23883  uint32_t baudRate ) ;
23884 //******************************************************************************
23885 /* Function:
23886  bool PLIB_SPI_IsBusy (SPI_MODULE_ID index)
23887  Summary:
23888  Returns the current SPI module activity status.
23889  Description:
23890  This function returns the current SPI module activity status.
23891  This operation is atomic.
23892  Precondition:
23893  None.
23894  Parameters:
23895  index - Identifier for the device instance to be configured
23896  Returns:
23897  - true - SPI module is currently busy with some transactions
23898  - false - SPI module is currently idle
23899  Example:
23900  <code>
23901  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23902  // application developer.
23903  bool status = PLIB_SPI_IsBusy(MY_SPI_INSTANCE);
23904  </code>
23905  Remarks:
23906  This function implements an operation of the bus status feature.
23907  This feature may not be available on all devices. Please refer to the
23908  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBusStatus"
23909  in your application to automatically determine whether this feature is available.
23910  */
23911 
23912 bool
23913  PLIB_SPI_IsBusy (
23914  SPI_MODULE_ID index ) ;
23915 //******************************************************************************
23916 /* Function:
23917  bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
23918  Summary:
23919  Returns the current status of the receive (RX) FIFO sign-extended data.
23920  Description:
23921  This function returns the current status of the receive (RX) FIFO
23922  sign-extended data.
23923  This operation is atomic.
23924  Precondition:
23925  None.
23926  Parameters:
23927  index - Identifier for the device instance to be configured
23928  Returns:
23929  - true - Data from RX FIFO is sign-extended
23930  - false - Data from RX FIFO is not sign-extended
23931  Example:
23932  <code>
23933  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23934  // application developer.
23935  bool Status = PLIB_SPI_ReadDataIsSignExtended(MY_SPI_INSTANCE);
23936  </code>
23937  Remarks:
23938  This function implements an operation of the data sign feature.
23939  This feature may not be available on all devices. Please refer to the
23940  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReadDataSignStatus"
23941  in your application to automatically determine whether this feature is available.
23942  */
23943 
23944 bool
23946  SPI_MODULE_ID index ) ;
23947 //******************************************************************************
23948 /* Function:
23949  void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
23950  Summary:
23951  Enables Master mode slave select.
23952  Description:
23953  This function enables Master mode slave select.
23954  This operation is atomic.
23955  Precondition:
23956  None.
23957  Parameters:
23958  index - Identifier for the device instance to be configured
23959  Returns:
23960  None.
23961  Example:
23962  <code>
23963  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23964  // application developer.
23965  PLIB_SPI_SlaveSelectEnable(MY_SPI_INSTANCE);
23966  </code>
23967  Remarks:
23968  This feature does not support Framed SPI mode.
23969  This function implements an operation of the Master mode slave select feature.
23970  This feature may not be available on all devices. Please refer to the
23971  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
23972  in your application to automatically determine whether this feature is available.
23973 
23974  To enable Slave mode slave select pin (SSEN), PLIB_SPI_PinEnable API can be used.
23975  */
23976 
23977 void
23979  SPI_MODULE_ID index ) ;
23980 //******************************************************************************
23981 /* Function:
23982  void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
23983  Summary:
23984  Disables Master mode slave select.
23985  Description:
23986  This function disables Master mode slave select.
23987  This operation is atomic.
23988  Precondition:
23989  None.
23990  Parameters:
23991  index - Identifier for the device instance to be configured
23992  Returns:
23993  None.
23994  Example:
23995  <code>
23996  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
23997  // application developer.
23998  PLIB_SPI_SlaveSelectDisable(MY_SPI_INSTANCE);
23999  </code>
24000  Remarks:
24001  This feature does not support Framed SPI mode.
24002  This function implements an operation of the slave select feature.
24003  This feature may not be available on all devices. Please refer to the
24004  specific device data sheet to determine availability or use "PLIB_SPI_ExistsSlaveSelectControl"
24005  in your application to automatically determine whether this feature is available.
24006 
24007  To disable Slave mode slave select pin (SSEN), PLIB_SPI_PinDisable API can be used.
24008  */
24009 
24010 void
24012  SPI_MODULE_ID index ) ;
24013 //******************************************************************************
24014 /* Function:
24015  bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
24016  Summary:
24017  Returns the current status of the transmit underrun.
24018  Description:
24019  This function returns the current status of the transmit underrun.
24020  This operation is atomic.
24021  Precondition:
24022  None.
24023  Parameters:
24024  index - Identifier for the device instance to be configured
24025  Returns:
24026  - true - Transmit buffer has encountered an underrun condition
24027  - false - Transmit buffer run has not encountered an underrun condition
24028  Example:
24029  <code>
24030  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24031  // application developer.
24032  bool Status = PLIB_SPI_TransmitUnderRunStatusGet(MY_SPI_INSTANCE);
24033  </code>
24034  Remarks:
24035  Valid in Framed Sync mode.
24036  This function implements an operation of the transmit underrun status feature.
24037  This feature may not be available on all devices. Please refer to the
24038  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitUnderRunStatus"
24039  in your application to automatically determine whether this feature is available.
24040  */
24041 
24042 bool
24044  SPI_MODULE_ID index ) ;
24045 //******************************************************************************
24046 /* Function:
24047  void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
24048  Summary:
24049  Clears the SPI transmit underrun flag.
24050  Description:
24051  This function clears the SPI transmit underrun flag.
24052  This operation is atomic.
24053  Precondition:
24054  None.
24055  Parameters:
24056  index - Identifier for the device instance to be configured
24057  Returns:
24058  None.
24059  Example:
24060  <code>
24061  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24062  // application developer.
24063  PLIB_SPI_TransmitUnderRunStatusClear(MY_SPI_INSTANCE);
24064  </code>
24065  Remarks:
24066  This function implements an operation of the transmit underrun status feature.
24067  This feature may not be available on all devices. Please refer to the
24068  specific device data sheet to determine availability or use "ExistsTransmitUnderRunStatus"
24069  in your application to automatically determine whether this feature is available.
24070  */
24071 
24072 void
24074  SPI_MODULE_ID index ) ;
24075 //******************************************************************************
24076 /* Function:
24077  bool PLIB_SPI_TransmitBufferIsEmpty (SPI_MODULE_ID index)
24078  Summary:
24079  Returns the current status of the transmit buffer.
24080  Description:
24081  This function returns the current status of the transmit buffer.
24082  This operation is atomic.
24083  Precondition:
24084  None.
24085  Parameters:
24086  index - Identifier for the device instance to be configured
24087  Returns:
24088  - true - Transmit buffer is empty
24089  - false - Transmit buffer is not empty
24090  Example:
24091  <code>
24092  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24093  // application developer.
24094  bool Status = PLIB_SPI_TransmitBufferIsEmpty(MY_SPI_INSTANCE);
24095  </code>
24096  Remarks:
24097  This function implements an operation of the transmit buffer empty status feature.
24098  This feature may not be available on all devices. Please refer to the
24099  specific device data sheet to determine availability or use "PLIB_SPI_ExistsTransmitBufferEmptyStatus"
24100  in your application to automatically determine whether this feature is available.
24101  */
24102 
24103 bool
24105  SPI_MODULE_ID index ) ;
24106 //******************************************************************************
24107 /* Function:
24108  void PLIB_SPI_FIFOEnable (SPI_MODULE_ID index)
24109  Summary:
24110  Enables the SPI enhanced buffer.
24111  Description:
24112  This function enables the SPI enhanced buffer.
24113  This operation is atomic.
24114  Precondition:
24115  None.
24116  Parameters:
24117  index - Identifier for the device instance to be configured
24118  Returns:
24119  None.
24120  Example:
24121  <code>
24122  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24123  // application developer.
24124  PLIB_SPI_FIFOEnable(MY_SPI_INSTANCE);
24125  </code>
24126  Remarks:
24127  This enables the enhanced buffer mode.
24128  This function implements an operation of the FIFO control feature.
24129  This feature may not be available on all devices. Please refer to the
24130  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24131  in your application to automatically determine whether this feature is available.
24132  */
24133 
24134 void
24136  SPI_MODULE_ID index ) ;
24137 //******************************************************************************
24138 /* Function:
24139  void PLIB_SPI_FIFODisable (SPI_MODULE_ID index)
24140  Summary:
24141  Disables the SPI enhanced buffer.
24142  Description:
24143  This function disables the SPI enhanced buffer.
24144  This operation is atomic.
24145  Precondition:
24146  None.
24147  Parameters:
24148  index - Identifier for the device instance to be configured
24149  Returns:
24150  None.
24151  Example:
24152  <code>
24153  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24154  // application developer.
24155  PLIB_SPI_FIFODisable(MY_SPI_INSTANCE);
24156  </code>
24157  Remarks:
24158  Enables the legacy standard single buffer mode.
24159  This function implements an operation of the FIFO control feature.
24160  This feature may not be available on all devices. Please refer to the
24161  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOControl"
24162  in your application to automatically determine whether this feature is available.
24163  */
24164 
24165 void
24167  SPI_MODULE_ID index ) ;
24168 //******************************************************************************
24169 /* Function:
24170  uint8_t PLIB_SPI_FIFOCountGet (SPI_MODULE_ID index, SPI_FIFO_TYPE type)
24171  Summary:
24172  Reads the SPI Buffer Element Count bits for either receive or transmit.
24173  Description:
24174  This function reads the number of SPI transfers pending for Master mode
24175  and the number of unread SPI transfers for Slave mode.
24176  Precondition:
24177  None.
24178  Parameters:
24179  index - Identifier for the device instance to be configured
24180  type - One of the SPI_FIFO_TYPE enumeration values
24181  Returns:
24182  CountValue - Buffer element count bits
24183  Example:
24184  <code>
24185  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24186  // application developer.
24187  uint8_t count = PLIB_SPI_FIFOCountGet(MY_SPI_INSTANCE,SPI_FIFO_TYPE_TRANSMIT);
24188  </code>
24189  Remarks:
24190  Valid in Enhanced Buffer mode.
24191  This function implements an operation of the FIFO control feature.
24192  This feature may not be available on all devices. Please refer to the
24193  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOCount"
24194  in your application to automatically determine whether this feature is available.
24195  */
24196 
24197 uint8_t
24199  SPI_MODULE_ID index ,
24200  SPI_FIFO_TYPE type ) ;
24201 //******************************************************************************
24202 /* Function:
24203  bool PLIB_SPI_FIFOShiftRegisterIsEmpty (SPI_MODULE_ID index)
24204  Summary:
24205  Returns the current status of the SPI shift register.
24206  Description:
24207  This function returns the current status of the SPI shift register.
24208  This operation is atomic.
24209  Precondition:
24210  None.
24211  Parameters:
24212  index - Identifier for the device instance to be configured
24213  Returns:
24214  - true - SPI shift register is empty and ready to send or receive
24215  - false - SPI shift register is not empty
24216  Example:
24217  <code>
24218  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24219  // application developer.
24220  bool Status = PLIB_SPI_FIFOShiftRegisterIsEmpty(MY_SPI_INSTANCE);
24221  </code>
24222  Remarks:
24223  Valid in Enhanced Buffer mode.
24224  This function implements an operation of the FIFO status feature.
24225  This feature may not be available on all devices. Please refer to the
24226  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus"
24227  in your application to automatically determine whether this feature is available.
24228  */
24229 
24230 bool
24232  SPI_MODULE_ID index ) ;
24233 //******************************************************************************
24234 /* Function:
24235  bool PLIB_SPI_ReceiverFIFOIsEmpty (SPI_MODULE_ID index)
24236  Summary:
24237  Returns the current status of the SPI receive FIFO.
24238  Description:
24239  This function returns the current status of the SPI receive FIFO.
24240  This operation is atomic.
24241  Precondition:
24242  None.
24243  Parameters:
24244  index - Identifier for the device instance to be configured
24245  Returns:
24246  - true - Receive FIFO is empty
24247  - false - Receive FIFO is not empty
24248  Example:
24249  <code>
24250  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24251  // application developer.
24252  bool fifostate = PLIB_SPI_ReceiverFIFOIsEmpty (MY_SPI_INSTANCE);
24253  </code>
24254  Remarks:
24255  Valid in Enhanced Buffer mode.
24256  This function implements an operation of the FIFO status feature.
24257  This feature may not be available on all devices. Please refer to the
24258  specific device data sheet to determine availability or use "PLIB_SPI_ExistsReceiveFIFOStatus"
24259  in your application to automatically determine whether this feature is available.
24260  */
24261 
24262 bool
24264  SPI_MODULE_ID index ) ;
24265 //******************************************************************************
24266 /* Function:
24267  void PLIB_SPI_FIFOInterruptModeSelect (SPI_MODULE_ID index,
24268  SPI_FIFO_INTERRUPT mode)
24269  Summary:
24270  Selects the SPI buffer interrupt mode.
24271  Description:
24272  This function selects the SPI buffer interrupt mode from SPI_FIFO_INTERRUPT.
24273  Precondition:
24274  None.
24275  Parameters:
24276  index - Identifier for the device instance to be configured
24277  mode - One of the SPI_FIFO_INTERRUPT enumeration values as the SPI buffer
24278  interrupt mode
24279  Returns:
24280  None.
24281  Example:
24282  <code>
24283  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24284  // application developer.
24285  PLIB_SPI_FIFOInterruptModeSelect(MY_SPI_INSTANCE,
24286  SPI_FIFO_INTERRUPT_WHEN_TRANSMIT_BUFFER_IS_NOT_FULL);
24287  </code>
24288  Remarks:
24289  Valid in Enhanced Buffer mode.
24290  This function implements an operation of the FIFO interrupt feature.
24291  This feature may not be available on all devices. Please refer to the
24292  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFIFOInterruptMode"
24293  in your application to automatically determine whether this feature is available.
24294  */
24295 
24296 void
24298  SPI_MODULE_ID index ,
24299  SPI_FIFO_INTERRUPT mode ) ;
24300 //******************************************************************************
24301 /* Function:
24302  void PLIB_SPI_FramedCommunicationEnable (SPI_MODULE_ID index)
24303  Summary:
24304  Enables framed SPI support.
24305  Description:
24306  This function enables framed SPI support.
24307  This operation is atomic.
24308  Precondition:
24309  None.
24310  Parameters:
24311  index - Identifier for the device instance to be configured
24312  Returns:
24313  None.
24314  Example:
24315  <code>
24316  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24317  // application developer.
24318  PLIB_SPI_FramedCommunicationEnable(MY_SPI_INSTANCE);
24319  </code>
24320  Remarks:
24321  This function implements an operation of the framed communication feature.
24322  This feature may not be available on all devices. Please refer to the
24323  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24324  in your application to automatically determine whether this feature is available.
24325  */
24326 
24327 void
24329  SPI_MODULE_ID index ) ;
24330 //******************************************************************************
24331 /* Function:
24332  void PLIB_SPI_FramedCommunicationDisable (SPI_MODULE_ID index)
24333  Summary:
24334  Disables framed SPI support.
24335  Description:
24336  This function disables framed SPI support.
24337  This operation is atomic.
24338  Precondition:
24339  None.
24340  Parameters:
24341  index - Identifier for the device instance to be configured
24342  Returns:
24343  None.
24344  Example:
24345  <code>
24346  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24347  // application developer.
24348  PLIB_SPI_FramedCommunicationDisable(MY_SPI_INSTANCE);
24349  </code>
24350  Remarks:
24351  This function implements an operation of the framed communication feature.
24352  This feature may not be available on all devices. Please refer to the
24353  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFramedCommunication"
24354  in your application to automatically determine whether this feature is available.
24355  */
24356 
24357 void
24359  SPI_MODULE_ID index ) ;
24360 //******************************************************************************
24361 /* Function:
24362  void PLIB_SPI_FrameSyncPulseDirectionSelect (SPI_MODULE_ID index,
24363  SPI_FRAME_PULSE_DIRECTION direction)
24364  Summary:
24365  Selects the frame sync pulse direction.
24366  Description:
24367  This function selects the frame sync pulse direction.
24368  Precondition:
24369  None.
24370  Parameters:
24371  index - Identifier for the device instance to be configured
24372  direction - One of the SPI_FRAME_PULSE_DIRECTION enumeration values
24373  as the SPI frame sync pulse polarity
24374  Returns:
24375  None.
24376  Example:
24377  <code>
24378  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24379  // application developer.
24380  PLIB_SPI_FrameSyncPulseDirectionSelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_DIRECTION_INPUT );
24381  </code>
24382  Remarks:
24383  This function implements an operation of the framed communication feature.
24384  This feature may not be available on all devices. Please refer to the
24385  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseDirection"
24386  in your application to automatically determine whether this feature is available.
24387  */
24388 
24389 void
24391  SPI_MODULE_ID index ,
24392  SPI_FRAME_PULSE_DIRECTION direction ) ;
24393 //******************************************************************************
24394 /* Function:
24395  void PLIB_SPI_FrameSyncPulsePolaritySelect (SPI_MODULE_ID index,
24396  SPI_FRAME_PULSE_POLARITY polarity)
24397  Summary:
24398  Selects the frame sync pulse polarity.
24399  Description:
24400  This function selects the frame sync pulse polarity.
24401  Precondition:
24402  None.
24403  Parameters:
24404  index - Identifier for the device instance to be configured
24405  polarity - One of the SPI_FRAME_PULSE_POLARITY enumeration values as the SPI frame
24406  sync pulse polarity
24407  Returns:
24408  None.
24409  Example:
24410  <code>
24411  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24412  // application developer.
24413  PLIB_SPI_FrameSyncPulsePolaritySelect(MY_SPI_INSTANCE, SPI_FRAME_PULSE_POLARITY_ACTIVE_HIGH );
24414  </code>
24415  Remarks:
24416  Available only for Frame mode.
24417  This function implements an operation of the framed communication feature.
24418  This feature may not be available on all devices. Please refer to the
24419  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulsePolarity"
24420  in your application to automatically determine whether this feature is available.
24421  */
24422 
24423 void
24425  SPI_MODULE_ID index ,
24426  SPI_FRAME_PULSE_POLARITY polarity ) ;
24427 //******************************************************************************
24428 /* Function:
24429  void PLIB_SPI_FrameSyncPulseEdgeSelect (SPI_MODULE_ID index,
24430  SPI_FRAME_PULSE_EDGE edge)
24431  Summary:
24432  Selects the frame sync pulse edge.
24433  Description:
24434  This function selects the frame sync pulse edge.
24435  Precondition:
24436  None.
24437  Parameters:
24438  index - Identifier for the device instance to be configured
24439  edge - One of the SPI_FRAME_PULSE_EDGE enumeration values as the
24440  SPI frame sync pulse edge
24441  Returns:
24442  None.
24443  Example:
24444  <code>
24445  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24446  // application developer.
24447  PLIB_SPI_FrameSyncPulseEdgeSelect(MY_SPI_INSTANCE,
24448  SPI_FRAME_PULSE_EDGE_COINCIDES_FIRST_BIT_CLOCK);
24449  </code>
24450  Remarks:
24451  This function implements an operation of the framed communication feature.
24452  This feature may not be available on all devices. Please refer to the
24453  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseEdge"
24454  in your application to automatically determine whether this feature is available.
24455  */
24456 
24457 void
24459  SPI_MODULE_ID index ,
24460  SPI_FRAME_PULSE_EDGE edge ) ;
24461 //******************************************************************************
24462 /* Function:
24463  void PLIB_SPI_FrameSyncPulseWidthSelect (SPI_MODULE_ID index,
24464  SPI_FRAME_PULSE_WIDTH width)
24465  Summary:
24466  Sets the frame sync pulse width.
24467  Description:
24468  This function sets the frame sync pulse width.
24469  Precondition:
24470  None.
24471  Parameters:
24472  index - Identifier for the device instance to be configured
24473  edge - One of the SPI_FRAME_PULSE_WIDTH enumeration values as the SPI
24474  frame sync pulse width.
24475  Returns:
24476  None.
24477  Example:
24478  <code>
24479  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24480  // application developer.
24481  PLIB_SPI_FrameSyncPulseWidthSelect (MY_SPI_INSTANCE,SPI_FRAME_PULSE_WIDTH_ONE_WORD_LENGTH);
24482  </code>
24483  Remarks:
24484  Length of the word is dependent on the communication mode.
24485  This function implements an operation of the framed communication feature.
24486  This feature may not be available on all devices. Please refer to the
24487  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseWidth"
24488  in your application to automatically determine whether this feature is available.
24489  */
24490 
24491 void
24493  SPI_MODULE_ID index ,
24494  SPI_FRAME_PULSE_WIDTH width ) ;
24495 //******************************************************************************
24496 /* Function:
24497  void PLIB_SPI_FrameSyncPulseCounterSelect (SPI_MODULE_ID index,
24498  SPI_FRAME_SYNC_PULSE pulse)
24499  Summary:
24500  Selects at which character the SPI frame sync pulse is generated.
24501  Description:
24502  This function selects at which character the SPI frame sync pulse is generated.
24503  Precondition:
24504  None.
24505  Parameters:
24506  index - Identifier for the device instance to be configured
24507  pulse - One of the SPI_FRAME_SYNC_PULSE enumeration values as the SPI
24508  frame sync pulse count
24509  Returns:
24510  None.
24511  Example:
24512  <code>
24513  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24514  // application developer.
24515  PLIB_SPI_FrameSyncPulseCounterSelect(MY_SPI_INSTANCE,
24516  SPI_FRAME_SYNC_PULSE_ON_EVERY_32_DATA_CHARACTER );
24517  </code>
24518  Remarks:
24519  This is valid only when PLIB_SPI_FramedCommunicationEnable is enabled.
24520  This function implements an operation of the framed communication feature.
24521  This feature may not be available on all devices. Please refer to the
24522  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameSyncPulseCounter"
24523  in your application to automatically determine whether this feature is available.
24524  */
24525 
24526 void
24528  SPI_MODULE_ID index ,
24529  SPI_FRAME_SYNC_PULSE pulse ) ;
24530 //******************************************************************************
24531 /* Function:
24532  bool PLIB_SPI_FrameErrorStatusGet (SPI_MODULE_ID index)
24533  Summary:
24534  Returns the current status of the SPI frame error.
24535  Description:
24536  This function returns the current status of the SPI frame error.
24537  This operation is atomic.
24538  Precondition:
24539  None.
24540  Parameters:
24541  index - Identifier for the device instance to be configured
24542  Returns:
24543  - true - Frame error detected
24544  - false - No frame error detected
24545  Example:
24546  <code>
24547  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24548  // application developer.
24549  bool status = PLIB_SPI_FrameErrorStatusGet(MY_SPI_INSTANCE);
24550  </code>
24551  Remarks:
24552  Valid only if Frame mode is enabled.
24553  This function implements an operation of the framed communication feature.
24554  This feature may not be available on all devices. Please refer to the
24555  specific device data sheet to determine availability or use "PLIB_SPI_ExistsFrameErrorStatus"
24556  in your application to automatically determine whether this feature is available.
24557  */
24558 
24559 bool
24561  SPI_MODULE_ID index ) ;
24562 //******************************************************************************
24563 /* Function:
24564  void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
24565  Summary:
24566  Clears the SPI frame error flag.
24567  Description:
24568  This function clears the SPI frame error flag.
24569  This operation is atomic.
24570  Precondition:
24571  None.
24572  Parameters:
24573  index - Identifier for the device instance to be configured
24574  Returns:
24575  None.
24576  Example:
24577  <code>
24578  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24579  // application developer.
24580  PLIB_SPI_FrameErrorStatusClear(MY_SPI_INSTANCE);
24581  </code>
24582  Remarks:
24583  This function implements an operation of the frame error status feature.
24584  This feature may not be available on all devices. Please refer to the
24585  specific device data sheet to determine availability or use "ExistsFrameErrorStatus"
24586  in your application to automatically determine whether this feature is available.
24587  */
24588 
24589 void
24591  SPI_MODULE_ID index ) ;
24592 //******************************************************************************
24593 /* Function:
24594  void PLIB_SPI_BufferClear (SPI_MODULE_ID index)
24595  Summary:
24596  Clears the SPI receive buffer.
24597  Description:
24598  This function clears the SPI receive buffer.
24599  In Enhanced Buffer mode, this functions clears the full RX FIFO.
24600  This operation is atomic.
24601  Precondition:
24602  None.
24603  Parameters:
24604  index - Identifier for the device instance to be configured
24605  Returns:
24606  None.
24607  Example:
24608  <code>
24609  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24610  // application developer.
24611  //This call will flush the receive buffer.
24612  PLIB_SPI_BufferClear(MY_SPI_INSTANCE);
24613  </code>
24614  Remarks:
24615  This function implements an operation of the buffer control feature.
24616  This feature may not be available on all devices. Please refer to the
24617  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24618  in your application to automatically determine whether this feature is available.
24619  */
24620 
24621 void
24623  SPI_MODULE_ID index ) ;
24624 //******************************************************************************
24625 /* Function:
24626  uint8_t PLIB_SPI_BufferRead (SPI_MODULE_ID index)
24627  Summary:
24628  Returns the SPI buffer value.
24629  Description:
24630  This function returns the SPI buffer value.
24631  This operation is atomic.
24632  Precondition:
24633  None.
24634  Parameters:
24635  index - Identifier for the device instance to be configured
24636  Returns:
24637  Reads the SPI buffer.
24638  Example:
24639  <code>
24640  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24641  // application developer.
24642  uint8_t bufferValue = PLIB_SPI_BufferRead(MY_SPI_INSTANCE);
24643  </code>
24644  Remarks:
24645  This function implements an operation of the buffer control feature.
24646  This feature may not be available on all devices. Please refer to the
24647  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24648  in your application to automatically determine whether this feature is available.
24649  */
24650 
24651 uint8_t
24653  SPI_MODULE_ID index ) ;
24654 //******************************************************************************
24655 /* Function:
24656  uint16_t PLIB_SPI_BufferRead16bit ( SPI_MODULE_ID index )
24657  Summary:
24658  Returns 16-bit SPI buffer value.
24659  Description:
24660  This function returns 16-bit SPI buffer value.
24661  This operation is atomic.
24662  Precondition:
24663  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24664  Parameters:
24665  index - Identifier for the device instance to be configured
24666  Returns:
24667  Returns the SPI 16-bit buffer value.
24668  Example:
24669  <code>
24670 #define MY_SPI_INSTANCE SPI_ID_1
24671 
24672  uint16_t bufferValue = PLIB_SPI_BufferRead16bit( MY_SPI_INSTANCE );
24673  </code>
24674  Remarks:
24675  This function implements an operation of the buffer control feature.
24676  This feature may not be available on all devices. Please refer to the
24677  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24678  in your application to automatically determine whether this feature is available.
24679  */
24680 
24681 uint16_t
24683  SPI_MODULE_ID index ) ;
24684 //******************************************************************************
24685 /* Function:
24686  uint32_t PLIB_SPI_BufferRead32bit ( SPI_MODULE_ID index )
24687  Summary:
24688  Returns 32-bit SPI buffer value.
24689  Description:
24690  This function returns 32-bit SPI buffer value.
24691  This operation is atomic.
24692  Precondition:
24693  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24694  Parameters:
24695  index - Identifier for the device instance to be configured
24696  Returns:
24697  Returns the SPI 32-bit buffer value.
24698  Example:
24699  <code>
24700 #define MY_SPI_INSTANCE SPI_ID_1
24701 
24702  uint32_t bufferValue = PLIB_SPI_BufferRead32bit( MY_SPI_INSTANCE );
24703  </code>
24704  Remarks:
24705  This function implements an operation of the buffer control feature.
24706  This feature may not be available on all devices. Please refer to the
24707  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24708  in your application to automatically determine whether this feature is available.
24709  */
24710 
24711 uint32_t
24713  SPI_MODULE_ID index ) ;
24714 //******************************************************************************
24715 /* Function:
24716  void PLIB_SPI_BufferWrite ( SPI_MODULE_ID index , uint8_t data )
24717  Summary:
24718  Write the data to the SPI buffer.
24719  Description:
24720  This function writes data to the SPI buffer.
24721  This operation is atomic.
24722  Precondition:
24723  None.
24724  Parameters:
24725  index - Identifier for the device instance to be configured
24726  data - Data to written to the SPI buffer
24727  Returns:
24728  None.
24729  Example:
24730  <code>
24731  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24732  // application developer.
24733  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0xFF );
24734  </code>
24735  Remarks:
24736  This function implements an operation of the buffer control feature.
24737  This feature may not be available on all devices. Please refer to the
24738  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBuffer"
24739  in your application to automatically determine whether this feature is available.
24740  */
24741 
24742 void
24744  SPI_MODULE_ID index ,
24745  uint8_t data ) ;
24746 //******************************************************************************
24747 /* Function:
24748  void PLIB_SPI_BufferWrite16bit ( SPI_MODULE_ID index , uint16_t data )
24749  Summary:
24750  Writes 16-bit data to the SPI buffer.
24751  Description:
24752  This function writes 16-bit data to the SPI buffer.
24753  This operation is atomic.
24754  Precondition:
24755  SPI 16-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24756  Parameters:
24757  index - Identifier for the device instance to be configured
24758  data - 16-bit data to be written to the SPI buffer
24759  Returns:
24760  None.
24761  Example:
24762  <code>
24763 #define MY_SPI_INSTANCE SPI_ID_1
24764 
24765  PLIB_SPI_BufferWrite16bit ( MY_SPI_INSTANCE, 0x55AA );
24766  </code>
24767  Remarks:
24768  This function implements an operation of the buffer control feature.
24769  This feature may not be available on all devices. Please refer to the
24770  specific device data sheet to determine availability or use "PLIB_SPI_Exists16bitBuffer"
24771  in your application to automatically determine whether this feature is available.
24772  */
24773 
24774 void
24776  SPI_MODULE_ID index ,
24777  uint16_t data ) ;
24778 //******************************************************************************
24779 /* Function:
24780  void PLIB_SPI_BufferWrite32bit ( SPI_MODULE_ID index , uint32_t data )
24781  Summary:
24782  Write 32-bit data to the SPI buffer.
24783  Description:
24784  This function writes 32-bit data to the SPI buffer.
24785  This operation is atomic.
24786  Precondition:
24787  SPI 32-bit wide communication must be selected using PLIB_SPI_CommunicationWidthSelect.
24788  Parameters:
24789  index - Identifier for the device instance to be configured
24790  data - 32-bit data to be written to the SPI buffer
24791  Returns:
24792  None.
24793  Example:
24794  <code>
24795 #define MY_SPI_INSTANCE SPI_ID_1
24796 
24797  PLIB_SPI_BufferWrite ( MY_SPI_INSTANCE, 0x55AA55AA );
24798  </code>
24799  Remarks:
24800  This function implements an operation of the buffer control feature.
24801  This feature may not be available on all devices. Please refer to the
24802  specific device data sheet to determine availability or use "PLIB_SPI_Exists32bitBuffer"
24803  in your application to automatically determine whether this feature is available.
24804  */
24805 
24806 void
24808  SPI_MODULE_ID index ,
24809  uint32_t data ) ;
24810 //******************************************************************************
24811 /* Function : PLIB_SPI_BufferAddressGet( SPI_MODULE_ID index )
24812  Summary:
24813  Returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive (SPIxRXB))
24814  register.
24815  Description:
24816  This function returns the address of the SPIxBUF (Transmit(SPIxTXB) and Receive
24817  (SPIxRXB)) register.
24818  This operation is atomic.
24819  Preconditions:
24820  None.
24821  Parameters:
24822  index - Identifier for the device instance
24823  Returns:
24824  The address of the SPIxBUF register
24825  Remarks:
24826  None.
24827 */
24828 
24829 void *
24831  SPI_MODULE_ID index ) ;
24832 //******************************************************************************
24833 /* Function:
24834  void PLIB_SPI_BaudRateClockSelect (SPI_MODULE_ID index,
24835  SPI_BAUD_RATE_CLOCK type)
24836  Summary:
24837  Selects the type of clock is used by the Baud Rate Generator.
24838  Description:
24839  This function selects the type of clock is used by the Baud Rate Generator.
24840  Precondition:
24841  None.
24842  Parameters:
24843  index - Identifier for the device instance to be configured
24844  type - One of the SPI_BAUD_RATE_CLOCK enumeration values as the SPI baud clock
24845  Returns:
24846  None.
24847  Example:
24848  <code>
24849  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24850  // application developer.
24851  PLIB_SPI_BaudRateClockSelect (MY_SPI_INSTANCE, SPI_BAUD_RATE_MCLK_CLOCK);
24852  </code>
24853  Remarks:
24854  This function implements an operation of the baud rate clock control feature.
24855  This feature may not be available on all devices. Please refer to the
24856  specific device data sheet to determine availability or use "PLIB_SPI_ExistsBaudRateClock"
24857  in your application to automatically determine whether this feature is available.
24858  */
24859 
24860 void
24862  SPI_MODULE_ID index ,
24863  SPI_BAUD_RATE_CLOCK type ) ;
24864 //******************************************************************************
24865 /* Function:
24866  void PLIB_SPI_ErrorInterruptEnable (SPI_MODULE_ID index,
24867  SPI_ERROR_INTERRUPT error)
24868  Summary:
24869  Enables SPI error interrupts
24870  Description:
24871  This function enables SPI error interrupts.
24872  Precondition:
24873  None.
24874  Parameters:
24875  index - Identifier for the device instance to be configured
24876  type - One of the SPI_ERROR_INTERRUPT enumeration values as the
24877  SPI interrupt error
24878  Returns:
24879  None.
24880  Example:
24881  <code>
24882  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24883  // application developer.
24884  PLIB_SPI_ErrorInterruptEnable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24885  </code>
24886  Remarks:
24887  This function implements an operation of the error interrupt control feature.
24888  This feature may not be available on all devices. Please refer to the
24889  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24890  in your application to automatically determine whether this feature is available.
24891  */
24892 
24893 void
24895  SPI_MODULE_ID index ,
24896  SPI_ERROR_INTERRUPT error ) ;
24897 //******************************************************************************
24898 /* Function:
24899  void PLIB_SPI_ErrorInterruptDisable (SPI_MODULE_ID index,
24900  SPI_ERROR_INTERRUPT error)
24901  Summary:
24902  Enables SPI error interrupts.
24903  Description:
24904  This function enables SPI error interrupts.
24905  Precondition:
24906  None.
24907  Parameters:
24908  index - Identifier for the device instance to be configured
24909  error - One of the SPI_ERROR_INTERRUPT enumeration values as the
24910  SPI interrupt error
24911  Returns:
24912  None.
24913  Example:
24914  <code>
24915  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24916  // application developer.
24917  PLIB_SPI_ErrorInterruptDisable (MY_SPI_INSTANCE, SPI_ERROR_INTERRUPT_FRAME_ERROR_OVERFLOW);
24918  </code>
24919  Remarks:
24920  This function implements an operation of the error interrupt control feature.
24921  This feature may not be available on all devices. Please refer to the
24922  specific device data sheet to determine availability or use "PLIB_SPI_ExistsErrorInterruptControl"
24923  in your application to automatically determine whether this feature is available.
24924  */
24925 
24926 void
24928  SPI_MODULE_ID index ,
24929  SPI_ERROR_INTERRUPT error ) ;
24930 //******************************************************************************
24931 /* Function:
24932  void PLIB_SPI_AudioErrorEnable (SPI_MODULE_ID index, SPI_Audio_ERROR error)
24933  Summary:
24934  Enables the SPI error.
24935  Description:
24936  This function enables the SPI error.
24937  This operation is atomic.
24938  Precondition:
24939  None.
24940  Parameters:
24941  index - Identifier for the device instance to be configured
24942  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24943  Returns:
24944  None.
24945  Example:
24946  <code>
24947  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24948  // application developer.
24949  PLIB_SPI_AudioErrorEnable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24950  </code>
24951  Remarks:
24952  This function implements an operation of the audio error control feature.
24953  This feature may not be available on all devices. Please refer to the
24954  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24955  in your application to automatically determine whether this feature is available.
24956  */
24957 
24958 void
24960  SPI_MODULE_ID index ,
24961  SPI_AUDIO_ERROR error ) ;
24962 //******************************************************************************
24963 /* Function:
24964  void PLIB_SPI_AudioErrorDisable (SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
24965  Summary:
24966  Disables the SPI error.
24967  Description:
24968  This function disables the SPI error.
24969  This operation is atomic.
24970  Precondition:
24971  None.
24972  Parameters:
24973  index - Identifier for the device instance to be configured
24974  error - One of the SPI_AUDIO_ERROR enumeration values as the SPI error
24975  Returns:
24976  None.
24977  Example:
24978  <code>
24979  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
24980  // application developer.
24981  PLIB_SPI_AudioErrorDisable (MY_SPI_INSTANCE, SPI_AUDIO_ERROR_RECEIVE_OVERFLOW);
24982  </code>
24983  Remarks:
24984  This function implements an operation of the audio error control feature.
24985  This feature may not be available on all devices. Please refer to the
24986  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioErrorControl"
24987  in your application to automatically determine whether this feature is available.
24988  */
24989 
24990 void
24992  SPI_MODULE_ID index ,
24993  SPI_AUDIO_ERROR error ) ;
24994 //******************************************************************************
24995 /* Function:
24996  void PLIB_SPI_AudioProtocolEnable (SPI_MODULE_ID index)
24997  Summary:
24998  Audio protocol is enabled.
24999  Description:
25000  This function enables the audio protocol.
25001  This operation is atomic.
25002  Precondition:
25003  Disable the SPI module by calling PLIB_SPI_Disable.
25004  Parameters:
25005  index - Identifier for the device instance to be configured
25006  Returns:
25007  None.
25008  Example:
25009  <code>
25010  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25011  // application developer.
25012  PLIB_SPI_AudioProtocolEnable(MY_SPI_INSTANCE);
25013  </code>
25014  Remarks:
25015  This function implements an operation of the audio protocol control feature.
25016  This feature may not be available on all devices. Please refer to the
25017  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25018  in your application to automatically determine whether this feature is available.
25019  */
25020 
25021 void
25023  SPI_MODULE_ID index ) ;
25024 //******************************************************************************
25025 /* Function:
25026  void PLIB_SPI_AudioProtocolDisable (SPI_MODULE_ID index)
25027  Summary:
25028  Audio protocol is disabled.
25029  Description:
25030  This function disables the audio protocol.
25031  This operation is atomic.
25032  Precondition:
25033  None.
25034  Parameters:
25035  index - Identifier for the device instance to be configured
25036  Returns:
25037  None.
25038  Example:
25039  <code>
25040  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25041  // application developer.
25042  PLIB_SPI_AudioProtocolDisable(MY_SPI_INSTANCE);
25043  </code>
25044  Remarks:
25045  This function implements an operation of the audio protocol control feature.
25046  This feature may not be available on all devices. Please refer to the
25047  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolControl"
25048  in your application to automatically determine whether this feature is available.
25049  */
25050 
25051 void
25053  SPI_MODULE_ID index ) ;
25054 //******************************************************************************
25055 /* Function:
25056  void PLIB_SPI_AudioTransmitModeSelect (SPI_MODULE_ID index,
25057  SPI_AUDIO_TRANSMIT_MODE mode)
25058  Summary:
25059  Selects the transmit audio data format.
25060  Description:
25061  This function selects the transmit audio data format.
25062  Precondition:
25063  None.
25064  Parameters:
25065  index - Identifier for the device instance to be configured
25066  mode - One of the SPI_TRANSMIT_AUDIO_MODE enumeration values as the
25067  transmit audio format
25068  Returns:
25069  None.
25070  Example:
25071  <code>
25072  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25073  // application developer.
25074  PLIB_SPI_AudioTransmitModeSelect (MY_SPI_INSTANCE, SPI_AUDIO_TRANSMIT_MONO);
25075  </code>
25076  Remarks:
25077  This function implements an operation of the audio transmit mode feature.
25078  This feature may not be available on all devices. Please refer to the
25079  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioTransmitMode"
25080  in your application to automatically determine whether this feature is available.
25081  */
25082 
25083 void
25085  SPI_MODULE_ID index ,
25086  SPI_AUDIO_TRANSMIT_MODE mode ) ;
25087 //******************************************************************************
25088 /* Function:
25089  void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index,
25090  SPI_AUDIO_PROTOCOL mode )
25091  Summary:
25092  Selects the Audio Protocol mode.
25093  Description:
25094  This function selects the Audio Protocol mode.
25095  Precondition:
25096  None.
25097  Parameters:
25098  index - Identifier for the device instance to be configured
25099  mode - One of the SPI_AUDIO_PROTOCOL enumeration values as the
25100  audio protocol
25101  Returns:
25102  None.
25103  Example:
25104  <code>
25105  // Where MY_SPI_INSTANCE, is the SPI instance selected for use by the
25106  // application developer.
25107  PLIB_SPI_AudioProtocolModeSelect(MY_SPI_INSTANCE,SPI_AUDIO_PROTOCOL_RIGHT_JUSTIFIED );
25108  </code>
25109  Remarks:
25110  This function implements an operation of the audio protocol mode feature.
25111  This feature may not be available on all devices. Please refer to the
25112  specific device data sheet to determine availability or use "PLIB_SPI_ExistsAudioProtocolMode"
25113  in your application to automatically determine whether this feature is available.
25114  */
25115 
25116 void
25118  SPI_MODULE_ID index ,
25119  SPI_AUDIO_PROTOCOL mode ) ;
25120 // *****************************************************************************
25121 // *****************************************************************************
25122 // Section: SPI Peripheral Library Exists Functions
25123 // *****************************************************************************
25124 // *****************************************************************************
25125 /* The following functions indicate the existence of the features on the device.
25126 */
25127 //******************************************************************************
25128 /* Function:
25129  PLIB_SPI_ExistsEnableControl( SPI_MODULE_ID index )
25130  Summary:
25131  Identifies whether the EnableControl feature exists on the SPI module.
25132  Description:
25133  This function identifies whether the EnableControl feature is available on
25134  the SPI module.
25135  When this function returns true, these functions are supported on the device:
25136  - PLIB_SPI_Enable
25137  - PLIB_SPI_Disable
25138  This operation is atomic.
25139  Preconditions:
25140  None.
25141  Parameters:
25142  index - Identifier for the device instance
25143  Returns:
25144  - true - The EnableControl feature is supported on the device
25145  - false - The EnableControl feature is not supported on the device
25146  Remarks:
25147  None.
25148 */
25149 
25150 bool
25152  SPI_MODULE_ID index ) ;
25153 //******************************************************************************
25154 /* Function:
25155  PLIB_SPI_ExistsStopInIdleControl( SPI_MODULE_ID index )
25156  Summary:
25157  Identifies whether the StopInIdle feature exists on the SPI module.
25158  Description:
25159  This function identifies whether the StopInIdle feature is available on the
25160  SPI module.
25161  When this function returns true, these functions are supported on the device:
25162  - PLIB_SPI_StopInIdleEnable
25163  - PLIB_SPI_StopInIdleDisable
25164  This operation is atomic.
25165  Preconditions:
25166  None.
25167  Parameters:
25168  index - Identifier for the device instance
25169  Returns:
25170  - true - The StopInIdle feature is supported on the device
25171  - false - The StopInIdle feature is not supported on the device
25172  Remarks:
25173  None.
25174 */
25175 
25176 bool
25178  SPI_MODULE_ID index ) ;
25179 //******************************************************************************
25180 /* Function:
25181  PLIB_SPI_ExistsReceiverOverflow( SPI_MODULE_ID index )
25182  Summary:
25183  Identifies whether the ReceiverOverflow feature exists on the SPI module.
25184  Description:
25185  This function identifies whether the ReceiverOverflow feature is available
25186  on the SPI module.
25187  When this function returns true, these functions are supported on the device:
25188  - PLIB_SPI_ReceiverHasOverflowed
25189  - PLIB_SPI_ReceiverOverflowClear
25190  This operation is atomic.
25191  Preconditions:
25192  None.
25193  Parameters:
25194  index - Identifier for the device instance
25195  Returns:
25196  - true - The ReceiverOverflow feature is supported on the device
25197  - false - The ReceiverOverflow feature is not supported on the device
25198  Remarks:
25199  None.
25200 */
25201 
25202 bool
25204  SPI_MODULE_ID index ) ;
25205 //******************************************************************************
25206 /* Function:
25207  PLIB_SPI_ExistsTransmitBufferFullStatus( SPI_MODULE_ID index )
25208  Summary:
25209  Identifies whether the TransmitBufferFullStatus feature exists on the SPI module.
25210  Description:
25211  This function identifies whether the TransmitBufferFullStatus feature is available
25212  on the SPI module.
25213  When this function returns true, this function is supported on the device:
25214  - PLIB_SPI_TransmitBufferIsFull
25215  This operation is atomic.
25216  Preconditions:
25217  None.
25218  Parameters:
25219  index - Identifier for the device instance
25220  Returns:
25221  - true - The TransmitBufferFullStatus feature is supported on the device
25222  - false - The TransmitBufferFullStatus feature is not supported on the device
25223  Remarks:
25224  None.
25225 */
25226 
25227 bool
25229  SPI_MODULE_ID index ) ;
25230 //******************************************************************************
25231 /* Function:
25232  PLIB_SPI_ExistsTransmitBufferEmptyStatus( SPI_MODULE_ID index )
25233  Summary:
25234  Identifies whether the TransmitBufferEmptyStatus feature exists on the SPI module.
25235  Description:
25236  This function identifies whether the TransmitBufferEmptyStatus feature is available
25237  on the SPI module.
25238  When this function returns true, this function is supported on the device:
25239  - PLIB_SPI_TransmitBufferIsEmpty
25240  This operation is atomic.
25241  Preconditions:
25242  None.
25243  Parameters:
25244  index - Identifier for the device instance
25245  Returns:
25246  - true - The TransmitBufferEmptyStatus feature is supported on the device
25247  - false - The TransmitBufferEmptyStatus feature is not supported on the device
25248  Remarks:
25249  None.
25250 */
25251 
25252 bool
25254  SPI_MODULE_ID index ) ;
25255 //******************************************************************************
25256 /* Function:
25257  PLIB_SPI_ExistsReceiveBufferStatus( SPI_MODULE_ID index )
25258  Summary:
25259  Identifies whether the ReceiveBufferStatus feature exists on the SPI module.
25260  Description:
25261  This function identifies whether the ReceiveBufferStatus feature is available
25262  on the SPI module.
25263  When this function returns true, this function is supported on the device:
25264  - PLIB_SPI_ReceiverBufferIsFull
25265  This operation is atomic.
25266  Preconditions:
25267  None.
25268  Parameters:
25269  index - Identifier for the device instance
25270  Returns:
25271  - true - The ReceiveBufferStatus feature is supported on the device
25272  - false - The ReceiveBufferStatus feature is not supported on the device
25273  Remarks:
25274  None.
25275 */
25276 
25277 bool
25279  SPI_MODULE_ID index ) ;
25280 //******************************************************************************
25281 /* Function:
25282  PLIB_SPI_ExistsPinControl( SPI_MODULE_ID index )
25283  Summary:
25284  Identifies whether the PinControl feature exists on the SPI module.
25285  Description:
25286  This function identifies whether the PinControl feature is available on the
25287  SPI module.
25288  When this function returns true, these functions are supported on the device:
25289  - PLIB_SPI_PinEnable
25290  - PLIB_SPI_PinDisable
25291  This operation is atomic.
25292  Preconditions:
25293  None.
25294  Parameters:
25295  index - Identifier for the device instance
25296  Returns:
25297  - true - The PinControl feature is supported on the device
25298  - false - The PinControl feature is not supported on the device
25299  Remarks:
25300  None.
25301 */
25302 
25303 bool
25305  SPI_MODULE_ID index ) ;
25306 //******************************************************************************
25307 /* Function:
25308  PLIB_SPI_ExistsCommunicationWidth( SPI_MODULE_ID index )
25309  Summary:
25310  Identifies whether the CommunicationWidth feature exists on the SPI module.
25311  Description:
25312  This function identifies whether the CommunicationWidth feature is available
25313  on the SPI module.
25314  When this function returns true, this function is supported on the device:
25315  - PLIB_SPI_CommunicationWidthSelect
25316  This operation is atomic.
25317  Preconditions:
25318  None.
25319  Parameters:
25320  index - Identifier for the device instance
25321  Returns:
25322  - true - The CommunicationWidth feature is supported on the device
25323  - false - The CommunicationWidth feature is not supported on the device
25324  Remarks:
25325  None.
25326 */
25327 
25328 bool
25330  SPI_MODULE_ID index ) ;
25331 //******************************************************************************
25332 /* Function:
25333  PLIB_SPI_ExistsAudioCommunicationWidth( SPI_MODULE_ID index )
25334  Summary:
25335  Identifies whether the AudioCommunicationWidth feature exists on the SPI module.
25336  Description:
25337  This function identifies whether the AudioCommunicationWidth feature is available
25338  on the SPI module.
25339  When this function returns true, this function is supported on the device:
25340  - PLIB_SPI_AudioCommunicationWidthSelect
25341  This operation is atomic.
25342  Preconditions:
25343  None.
25344  Parameters:
25345  index - Identifier for the device instance
25346  Returns:
25347  - true - The AudioCommunicationWidth feature is supported on the device
25348  - false - The AudioCommunicationWidth feature is not supported on the device
25349  Remarks:
25350  None.
25351 */
25352 
25353 bool
25355  SPI_MODULE_ID index ) ;
25356 //******************************************************************************
25357 /* Function:
25358  PLIB_SPI_ExistsInputSamplePhase( SPI_MODULE_ID index )
25359  Summary:
25360  Identifies whether the InputSamplePhase feature exists on the SPI module.
25361  Description:
25362  This function identifies whether the InputSamplePhase feature is available
25363  on the SPI module.
25364  When this function returns true, this function is supported on the device:
25365  - PLIB_SPI_InputSamplePhaseSelect
25366  This operation is atomic.
25367  Preconditions:
25368  None.
25369  Parameters:
25370  index - Identifier for the device instance
25371  Returns:
25372  - true - The InputSamplePhase feature is supported on the device
25373  - false - The InputSamplePhase feature is not supported on the device
25374  Remarks:
25375  None.
25376 */
25377 
25378 bool
25380  SPI_MODULE_ID index ) ;
25381 //******************************************************************************
25382 /* Function:
25383  PLIB_SPI_ExistsOutputDataPhase( SPI_MODULE_ID index )
25384  Summary:
25385  Identifies whether the OutputDataPhase feature exists on the SPI module.
25386  Description:
25387  This function identifies whether the OutputDataPhase feature is available on
25388  the SPI module.
25389  When this function returns true, this function is supported on the device:
25390  - PLIB_SPI_OutputDataPhaseSelect
25391  This operation is atomic.
25392  Preconditions:
25393  None.
25394  Parameters:
25395  index - Identifier for the device instance
25396  Returns:
25397  - true - The OutputDataPhase feature is supported on the device
25398  - false - The OutputDataPhase feature is not supported on the device
25399  Remarks:
25400  None.
25401 */
25402 
25403 bool
25405  SPI_MODULE_ID index ) ;
25406 //******************************************************************************
25407 /* Function:
25408  PLIB_SPI_ExistsClockPolarity( SPI_MODULE_ID index )
25409  Summary:
25410  Identifies whether the ClockPolarity feature exists on the SPI module.
25411  Description:
25412  This function identifies whether the ClockPolarity feature is available on
25413  the SPI module.
25414  When this function returns true, this function is supported on the device:
25415  - PLIB_SPI_ClockPolaritySelect
25416  This operation is atomic.
25417  Preconditions:
25418  None.
25419  Parameters:
25420  index - Identifier for the device instance
25421  Returns:
25422  - true - The ClockPolarity feature is supported on the device
25423  - false - The ClockPolarity feature is not supported on the device
25424  Remarks:
25425  None.
25426 */
25427 
25428 bool
25430  SPI_MODULE_ID index ) ;
25431 //******************************************************************************
25432 /* Function:
25433  PLIB_SPI_ExistsMasterControl( SPI_MODULE_ID index )
25434  Summary:
25435  Identifies whether the MasterControl feature exists on the SPI module.
25436  Description:
25437  This function identifies whether the MasterControl feature is available on
25438  the SPI module.
25439  When this function returns true, these functions are supported on the device:
25440  - PLIB_SPI_MasterEnable
25441  - PLIB_SPI_SlaveEnable
25442  This operation is atomic.
25443  Preconditions:
25444  None.
25445  Parameters:
25446  index - Identifier for the device instance
25447  Returns:
25448  - true - The MasterControl feature is supported on the device
25449  - false - The MasterControl feature is not supported on the device
25450  Remarks:
25451  None.
25452 */
25453 
25454 bool
25456  SPI_MODULE_ID index ) ;
25457 //******************************************************************************
25458 /* Function:
25459  PLIB_SPI_ExistsBaudRate( SPI_MODULE_ID index )
25460  Summary:
25461  Identifies whether the BaudRate feature exists on the SPI module.
25462  Description:
25463  This function identifies whether the BaudRate feature is available on the SPI
25464  module.
25465  When this function returns true, this function is supported on the device:
25466  - PLIB_SPI_BaudRateSet
25467  This operation is atomic.
25468  Preconditions:
25469  None.
25470  Parameters:
25471  index - Identifier for the device instance
25472  Returns:
25473  - true - The BaudRate feature is supported on the device
25474  - false - The BaudRate feature is not supported on the device
25475  Remarks:
25476  None.
25477 */
25478 
25479 bool
25481  SPI_MODULE_ID index ) ;
25482 //******************************************************************************
25483 /* Function:
25484  PLIB_SPI_ExistsBusStatus( SPI_MODULE_ID index )
25485  Summary:
25486  Identifies whether the BusStatus feature exists on the SPI module.
25487  Description:
25488  This function identifies whether the BusStatus feature is available on the
25489  SPI module.
25490  When this function returns true, this function is supported on the device:
25491  - PLIB_SPI_IsBusy
25492  This operation is atomic.
25493  Preconditions:
25494  None.
25495  Parameters:
25496  index - Identifier for the device instance
25497  Returns:
25498  - true - The BusStatus feature is supported on the device
25499  - false - The BusStatus feature is not supported on the device
25500  Remarks:
25501  None.
25502 */
25503 
25504 bool
25506  SPI_MODULE_ID index ) ;
25507 //******************************************************************************
25508 /* Function:
25509  PLIB_SPI_ExistsReadDataSignStatus( SPI_MODULE_ID index )
25510  Summary:
25511  Identifies whether the ReadDataSignStatus feature exists on the SPI module.
25512  Description:
25513  This function identifies whether the ReadDataSignStatus feature is available
25514  on the SPI module.
25515  When this function returns true, this function is supported on the device:
25516  - PLIB_SPI_ReadDataIsSignExtended
25517  This operation is atomic.
25518  Preconditions:
25519  None.
25520  Parameters:
25521  index - Identifier for the device instance
25522  Returns:
25523  - true - The ReadDataSignStatus feature is supported on the device
25524  - false - The ReadDataSignStatus feature is not supported on the device
25525  Remarks:
25526  None.
25527 */
25528 
25529 bool
25531  SPI_MODULE_ID index ) ;
25532 //******************************************************************************
25533 /* Function:
25534  PLIB_SPI_ExistsSlaveSelectControl( SPI_MODULE_ID index )
25535  Summary:
25536  Identifies whether the SlaveSelectControl feature exists on the SPI module.
25537  Description:
25538  This function identifies whether the SlaveSelectControl feature is available
25539  on the SPI module.
25540  When this function returns true, these functions are supported on the device:
25541  - PLIB_SPI_SlaveSelectEnable
25542  - PLIB_SPI_SlaveSelectDisable
25543  This operation is atomic.
25544  Preconditions:
25545  None.
25546  Parameters:
25547  index - Identifier for the device instance
25548  Returns:
25549  - true - The SlaveSelectControl feature is supported on the device
25550  - false - The SlaveSelectControl feature is not supported on the device
25551  Remarks:
25552  None.
25553 */
25554 
25555 bool
25557  SPI_MODULE_ID index ) ;
25558 //******************************************************************************
25559 /* Function:
25560  PLIB_SPI_ExistsTransmitUnderRunStatus( SPI_MODULE_ID index )
25561  Summary:
25562  Identifies whether the TransmitUnderRunStatus feature exists on the SPI module.
25563  Description:
25564  This function identifies whether the TransmitUnderRunStatus feature is available
25565  on the SPI module.
25566  When this function returns true, these functions are supported on the device:
25567  - PLIB_SPI_TransmitUnderRunStatusGet
25568  - PLIB_SPI_TransmitUnderRunStatusClear
25569  This operation is atomic.
25570  Preconditions:
25571  None.
25572  Parameters:
25573  index - Identifier for the device instance
25574  Returns:
25575  - true - The TransmitUnderRunStatus feature is supported on the device
25576  - false - The TransmitUnderRunStatus feature is not supported on the device
25577  Remarks:
25578  None.
25579 */
25580 
25581 bool
25583  SPI_MODULE_ID index ) ;
25584 //******************************************************************************
25585 /* Function:
25586  PLIB_SPI_ExistsFIFOControl( SPI_MODULE_ID index )
25587  Summary:
25588  Identifies whether the FIFOControl feature exists on the SPI module.
25589  Description:
25590  This function identifies whether the FIFOControl feature is available on the
25591  SPI module.
25592  When this function returns true, these functions are supported on the device:
25593  - PLIB_SPI_FIFOEnable
25594  - PLIB_SPI_FIFODisable
25595  This operation is atomic.
25596  Preconditions:
25597  None.
25598  Parameters:
25599  index - Identifier for the device instance
25600  Returns:
25601  - true - The FIFOControl feature is supported on the device
25602  - false - The FIFOControl feature is not supported on the device
25603  Remarks:
25604  None.
25605 */
25606 
25607 bool
25609  SPI_MODULE_ID index ) ;
25610 //******************************************************************************
25611 /* Function:
25612  PLIB_SPI_ExistsFIFOCount( SPI_MODULE_ID index )
25613  Summary:
25614  Identifies whether the FIFOCount feature exists on the SPI module.
25615  Description:
25616  This function identifies whether the FIFOCount feature is available on the SPI module.
25617  When this function returns true, this function is supported on the device:
25618  - PLIB_SPI_FIFOCountGet
25619  This operation is atomic.
25620  Preconditions:
25621  None.
25622  Parameters:
25623  index - Identifier for the device instance
25624  Returns:
25625  - true - The FIFOCount feature is supported on the device
25626  - false - The FIFOCount feature is not supported on the device
25627  Remarks:
25628  None.
25629 */
25630 
25631 bool
25633  SPI_MODULE_ID index ) ;
25634 //******************************************************************************
25635 /* Function:
25636  PLIB_SPI_ExistsReceiveFIFOStatus( SPI_MODULE_ID index )
25637  Summary:
25638  Identifies whether the ReceiveFIFOStatus feature exists on the SPI module.
25639  Description:
25640  This function identifies whether the ReceiveFIFOStatus feature is available
25641  on the SPI module.
25642  When this function returns true, this function is supported on the device:
25643  - PLIB_SPI_ReceiverFIFOIsEmpty
25644  This operation is atomic.
25645  Preconditions:
25646  None.
25647  Parameters:
25648  index - Identifier for the device instance
25649  Returns:
25650  - true - The ReceiveFIFOStatus feature is supported on the device
25651  - false - The ReceiveFIFOStatus feature is not supported on the device
25652  Remarks:
25653  None.
25654 */
25655 
25656 bool
25658  SPI_MODULE_ID index ) ;
25659 //******************************************************************************
25660 /* Function:
25661  PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus( SPI_MODULE_ID index )
25662  Summary:
25663  Identifies whether the FIFOShiftRegisterEmptyStatus feature exists on the SPI module.
25664  Description:
25665  This function identifies whether the FIFOShiftRegisterEmptyStatus feature is
25666  available on the SPI module.
25667  When this function returns true, this function is supported on the device:
25668  - PLIB_SPI_FIFOShiftRegisterIsEmpty
25669  This operation is atomic.
25670  Preconditions:
25671  None.
25672  Parameters:
25673  index - Identifier for the device instance
25674  Returns:
25675  - true - The FIFOShiftRegisterEmptyStatus feature is supported on the device
25676  - false - The FIFOShiftRegisterEmptyStatus feature is not supported on the device
25677  Remarks:
25678  None.
25679 */
25680 
25681 bool
25683  SPI_MODULE_ID index ) ;
25684 //******************************************************************************
25685 /* Function:
25686  PLIB_SPI_ExistsFIFOInterruptMode( SPI_MODULE_ID index )
25687  Summary:
25688  Identifies whether the FIFOInterruptMode feature exists on the SPI module.
25689  Description:
25690  This function identifies whether the FIFOInterruptMode feature is available
25691  on the SPI module.
25692  When this function returns true, this function is supported on the device:
25693  - PLIB_SPI_FIFOInterruptModeSelect
25694  This operation is atomic.
25695  Preconditions:
25696  None.
25697  Parameters:
25698  index - Identifier for the device instance
25699  Returns:
25700  - true - The FIFOInterruptMode feature is supported on the device
25701  - false - The FIFOInterruptMode feature is not supported on the device
25702  Remarks:
25703  None.
25704 */
25705 
25706 bool
25708  SPI_MODULE_ID index ) ;
25709 //******************************************************************************
25710 /* Function:
25711  PLIB_SPI_ExistsFramedCommunication( SPI_MODULE_ID index )
25712  Summary:
25713  Identifies whether the FramedCommunication feature exists on the SPI module.
25714  Description:
25715  This function identifies whether the FramedCommunication feature is available
25716  on the SPI module.
25717  When this function returns true, these functions are supported on the device:
25718  - PLIB_SPI_FramedCommunicationEnable
25719  - PLIB_SPI_FramedCommunicationDisable
25720  This operation is atomic.
25721  Preconditions:
25722  None.
25723  Parameters:
25724  index - Identifier for the device instance
25725  Returns:
25726  - true - The FramedCommunication feature is supported on the device
25727  - false - The FramedCommunication feature is not supported on the device
25728  Remarks:
25729  None.
25730 */
25731 
25732 bool
25734  SPI_MODULE_ID index ) ;
25735 //******************************************************************************
25736 /* Function:
25737  PLIB_SPI_ExistsFrameSyncPulseDirection( SPI_MODULE_ID index )
25738  Summary:
25739  Identifies whether the FrameSyncPulseDirection feature exists on the SPI module.
25740  Description:
25741  This function identifies whether the FrameSyncPulseDirection feature is available
25742  on the SPI module.
25743  When this function returns true, this function is supported on the device:
25744  - PLIB_SPI_FrameSyncPulseDirectionSelect
25745  This operation is atomic.
25746  Preconditions:
25747  None.
25748  Parameters:
25749  index - Identifier for the device instance
25750  Returns:
25751  - true - The FrameSyncPulseDirection feature is supported on the device
25752  - false - The FrameSyncPulseDirection feature is not supported on the device
25753  Remarks:
25754  None.
25755 */
25756 
25757 bool
25759  SPI_MODULE_ID index ) ;
25760 //******************************************************************************
25761 /* Function:
25762  PLIB_SPI_ExistsFrameSyncPulsePolarity( SPI_MODULE_ID index )
25763  Summary:
25764  Identifies whether the FrameSyncPulsePolarity feature exists on the SPI module.
25765  Description:
25766  This function identifies whether the FrameSyncPulsePolarity feature is available
25767  on the SPI module.
25768  When this function returns true, this function is supported on the device:
25769  - PLIB_SPI_FrameSyncPulsePolaritySelect
25770  This operation is atomic.
25771  Preconditions:
25772  None.
25773  Parameters:
25774  index - Identifier for the device instance
25775  Returns:
25776  - true - The FrameSyncPulsePolarity feature is supported on the device
25777  - false - The FrameSyncPulsePolarity feature is not supported on the device
25778  Remarks:
25779  None.
25780 */
25781 
25782 bool
25784  SPI_MODULE_ID index ) ;
25785 //******************************************************************************
25786 /* Function:
25787  PLIB_SPI_ExistsFrameSyncPulseEdge( SPI_MODULE_ID index )
25788  Summary:
25789  Identifies whether the FrameSyncPulseEdge feature exists on the SPI module.
25790  Description:
25791  This function identifies whether the FrameSyncPulseEdge feature is available
25792  on the SPI module.
25793  When this function returns true, this function is supported on the device:
25794  - PLIB_SPI_FrameSyncPulseEdgeSelect
25795  This operation is atomic.
25796  Preconditions:
25797  None.
25798  Parameters:
25799  index - Identifier for the device instance
25800  Returns:
25801  - true - The FrameSyncPulseEdge feature is supported on the device
25802  - false - The FrameSyncPulseEdge feature is not supported on the device
25803  Remarks:
25804  None.
25805 */
25806 
25807 bool
25809  SPI_MODULE_ID index ) ;
25810 //******************************************************************************
25811 /* Function:
25812  PLIB_SPI_ExistsFrameSyncPulseWidth( SPI_MODULE_ID index )
25813  Summary:
25814  Identifies whether the FrameSyncPulseWidth feature exists on the SPI module.
25815  Description:
25816  This function identifies whether the FrameSyncPulseWidth feature is available
25817  on the SPI module.
25818  When this function returns true, this function is supported on the device:
25819  - PLIB_SPI_FrameSyncPulseWidthSelect
25820  This operation is atomic.
25821  Preconditions:
25822  None.
25823  Parameters:
25824  index - Identifier for the device instance
25825  Returns:
25826  - true - The FrameSyncPulseWidth feature is supported on the device
25827  - false - The FrameSyncPulseWidth feature is not supported on the device
25828  Remarks:
25829  None.
25830 */
25831 
25832 bool
25834  SPI_MODULE_ID index ) ;
25835 //******************************************************************************
25836 /* Function:
25837  PLIB_SPI_ExistsFrameSyncPulseCounter( SPI_MODULE_ID index )
25838  Summary:
25839  Identifies whether the FrameSyncPulseCounter feature exists on the SPI module.
25840  Description:
25841  This function identifies whether the FrameSyncPulseCounter feature is available
25842  on the SPI module.
25843  When this function returns true, this function is supported on the device:
25844  - PLIB_SPI_FrameSyncPulseCounterSelect
25845  This operation is atomic.
25846  Preconditions:
25847  None.
25848  Parameters:
25849  index - Identifier for the device instance
25850  Returns:
25851  - true - The FrameSyncPulseCounter feature is supported on the device
25852  - false - The FrameSyncPulseCounter feature is not supported on the device
25853  Remarks:
25854  None.
25855 */
25856 
25857 bool
25859  SPI_MODULE_ID index ) ;
25860 //******************************************************************************
25861 /* Function:
25862  PLIB_SPI_ExistsFrameErrorStatus( SPI_MODULE_ID index )
25863  Summary:
25864  Identifies whether the FrameErrorStatus feature exists on the SPI module.
25865  Description:
25866  This function identifies whether the FrameErrorStatus feature is available on
25867  the SPI module.
25868  When this function returns true, these functions are supported on the device:
25869  - PLIB_SPI_FrameErrorStatusGet
25870  - PLIB_SPI_FrameErrorStatusClear
25871  This operation is atomic.
25872  Preconditions:
25873  None.
25874  Parameters:
25875  index - Identifier for the device instance
25876  Returns:
25877  - true - The FrameErrorStatus feature is supported on the device
25878  - false - The FrameErrorStatus feature is not supported on the device
25879  Remarks:
25880  None.
25881 */
25882 
25883 bool
25885  SPI_MODULE_ID index ) ;
25886 //******************************************************************************
25887 /* Function:
25888  PLIB_SPI_ExistsBuffer( SPI_MODULE_ID index )
25889  Summary:
25890  Identifies whether the Buffer feature exists on the SPI module.
25891  Description:
25892  This function identifies whether the Buffer feature is available on the SPI module.
25893  When this function returns true, these functions are supported on the device:
25894  - PLIB_SPI_BufferClear
25895  - PLIB_SPI_BufferRead
25896  - PLIB_SPI_BufferWrite
25897  - PLIB_SPI_BufferAddressGet
25898  This operation is atomic.
25899  Preconditions:
25900  None.
25901  Parameters:
25902  index - Identifier for the device instance
25903  Returns:
25904  - true - The Buffer feature is supported on the device
25905  - false - The Buffer feature is not supported on the device
25906  Remarks:
25907  None.
25908 */
25909 
25910 bool
25912  SPI_MODULE_ID index ) ;
25913 //******************************************************************************
25914 /* Function:
25915  PLIB_SPI_ExistsBaudRateClock( SPI_MODULE_ID index )
25916  Summary:
25917  Identifies whether the BaudRateClock feature exists on the SPI module.
25918  Description:
25919  This function identifies whether the BaudRateClock feature is available on
25920  the SPI module.
25921  When this function returns true, this function is supported on the device:
25922  - PLIB_SPI_BaudRateClockSelect
25923  This operation is atomic.
25924  Preconditions:
25925  None.
25926  Parameters:
25927  index - Identifier for the device instance
25928  Returns:
25929  - true - The BaudRateClock feature is supported on the device
25930  - false - The BaudRateClock feature is not supported on the device
25931  Remarks:
25932  None.
25933 */
25934 
25935 bool
25937  SPI_MODULE_ID index ) ;
25938 //******************************************************************************
25939 /* Function:
25940  PLIB_SPI_ExistsErrorInterruptControl( SPI_MODULE_ID index )
25941  Summary:
25942  Identifies whether the ErrorInterruptControl feature exists on the SPI module.
25943  Description:
25944  This function identifies whether the ErrorInterruptControl feature is available
25945  on the SPI module.
25946  When this function returns true, these functions are supported on the device:
25947  - PLIB_SPI_ErrorInterruptEnable
25948  - PLIB_SPI_ErrorInterruptDisable
25949  This operation is atomic.
25950  Preconditions:
25951  None.
25952  Parameters:
25953  index - Identifier for the device instance
25954  Returns:
25955  - true - The ErrorInterruptControl feature is supported on the device
25956  - false - The ErrorInterruptControl feature is not supported on the device
25957  Remarks:
25958  None.
25959 */
25960 
25961 bool
25963  SPI_MODULE_ID index ) ;
25964 //******************************************************************************
25965 /* Function:
25966  PLIB_SPI_ExistsAudioErrorControl( SPI_MODULE_ID index )
25967  Summary:
25968  Identifies whether the AudioErrorControl feature exists on the SPI module.
25969  Description:
25970  This function identifies whether the AudioErrorControl feature is available
25971  on the SPI module.
25972  When this function returns true, these functions are supported on the device:
25973  - PLIB_SPI_AudioErrorEnable
25974  - PLIB_SPI_AudioErrorDisable
25975  This operation is atomic.
25976  Preconditions:
25977  None.
25978  Parameters:
25979  index - Identifier for the device instance
25980  Returns:
25981  - true - The AudioErrorControl feature is supported on the device
25982  - false - The AudioErrorControl feature is not supported on the device
25983  Remarks:
25984  None.
25985 */
25986 
25987 bool
25989  SPI_MODULE_ID index ) ;
25990 //******************************************************************************
25991 /* Function:
25992  PLIB_SPI_ExistsAudioProtocolControl( SPI_MODULE_ID index )
25993  Summary:
25994  Identifies whether the AudioProtocolControl feature exists on the SPI module.
25995  Description:
25996  This function identifies whether the AudioProtocolControl feature is available
25997  on the SPI module.
25998  When this function returns true, this function is supported on the device:
25999  - PLIB_SPI_AudioProtocolEnable
26000  - PLIB_SPI_AudioProtocolDisable
26001  This operation is atomic.
26002  Preconditions:
26003  None.
26004  Parameters:
26005  index - Identifier for the device instance
26006  Returns:
26007  - true - The AudioProtocolControl feature is supported on the device
26008  - false - The AudioProtocolControl feature is not supported on the device
26009  Remarks:
26010  None.
26011 */
26012 
26013 bool
26015  SPI_MODULE_ID index ) ;
26016 //******************************************************************************
26017 /* Function:
26018  PLIB_SPI_ExistsAudioTransmitMode( SPI_MODULE_ID index )
26019  Summary:
26020  Identifies whether the AudioTransmitMode feature exists on the SPI module.
26021  Description:
26022  This function identifies whether the AudioTransmitMode feature is available
26023  on the SPI module.
26024  When this function returns true, this function is supported on the device:
26025  - PLIB_SPI_AudioTransmitModeSelect
26026  This operation is atomic.
26027  Preconditions:
26028  None.
26029  Parameters:
26030  index - Identifier for the device instance
26031  Returns:
26032  - true - The AudioTransmitMode feature is supported on the device
26033  - false - The AudioTransmitMode feature is not supported on the device
26034  Remarks:
26035  None.
26036 */
26037 
26038 bool
26040  SPI_MODULE_ID index ) ;
26041 //******************************************************************************
26042 /* Function:
26043  PLIB_SPI_ExistsAudioProtocolMode( SPI_MODULE_ID index )
26044  Summary:
26045  Identifies whether the AudioProtocolMode feature exists on the SPI module.
26046  Description:
26047  This function identifies whether the AudioProtocolMode feature is available
26048  on the SPI module.
26049  When this function returns true, this function is supported on the device:
26050  - PLIB_SPI_AudioProtocolModeSelect
26051  This operation is atomic.
26052  Preconditions:
26053  None.
26054  Parameters:
26055  index - Identifier for the device instance
26056  Returns:
26057  - true - The AudioProtocolMode feature is supported on the device
26058  - false - The AudioProtocolMode feature is not supported on the device
26059  Remarks:
26060  None.
26061 */
26062 
26063 bool
26065  SPI_MODULE_ID index ) ;
26066 //******************************************************************************
26067 /* Function:
26068  PLIB_SPI_Exists32bitBuffer( SPI_MODULE_ID index )
26069  Summary:
26070  Identifies whether the Buffer32bit feature exists on the SPI module.
26071  Description:
26072  This function identifies whether the Buffer32bit feature is available on the
26073  SPI module.
26074  When this function returns true, these functions are supported on the device:
26075  - PLIB_SPI_BufferRead32bit
26076  - PLIB_SPI_BufferWrite32bit
26077  This operation is atomic.
26078  Preconditions:
26079  None.
26080  Parameters:
26081  index - Identifier for the device instance
26082  Returns:
26083  - true - The Buffer32bit feature is supported on the device
26084  - false - The Buffer32bit feature is not supported on the device
26085  Remarks:
26086  None.
26087 */
26088 
26089 bool
26091  SPI_MODULE_ID index ) ;
26092 //******************************************************************************
26093 /* Function:
26094  PLIB_SPI_Exists16bitBuffer( SPI_MODULE_ID index )
26095  Summary:
26096  Identifies whether the Buffer16bit feature exists on the SPI module.
26097  Description:
26098  This function identifies whether the Buffer16bit feature is available on the
26099  SPI module.
26100  When this function returns true, these functions are supported on the device:
26101  - PLIB_SPI_BufferRead16bit
26102  - PLIB_SPI_BufferWrite16bit
26103  This operation is atomic.
26104  Preconditions:
26105  None.
26106  Parameters:
26107  index - Identifier for the device instance
26108  Returns:
26109  - true - The Buffer16bit feature is supported on the device
26110  - false - The Buffer16bit feature is not supported on the device
26111  Remarks:
26112  None.
26113 */
26114 
26115 bool
26117  SPI_MODULE_ID index ) ;
26118 //DOM-IGNORE-BEGIN
26119 //DOM-IGNORE-END
26120  // #ifndef _PLIB_SPI_H
26121 /*******************************************************************************
26122  End of File
26123  */
26124 
26125 #endif /*00 C:\microchip\harmony\v2_06\framework\peripheral\spi\plib_spi.h*/
26126 /* CLOSE_FILE Include File */
26127 
26128  // SPI PLIB Header
26129 #include "system/common/sys_common.h" // Common System Service Definitions
26130 #include "system/common/sys_module.h" // Module/Driver Definitions
26131 #include "system/int/sys_int.h" // System Interrupt Definitions
26132 #include "system/clk/sys_clk.h"
26133 #include "C:\microchip\harmony\v2_06\framework\system\ports\sys_ports.h"
26134  /* LDRA full path */
26135 // DOM-IGNORE-BEGIN
26136 // DOM-IGNORE-END
26137 // *****************************************************************************
26138 /* SPI Driver Buffer Handle
26139  Summary:
26140  Handle identifying a read or write buffer passed to the driver.
26141  Description:
26142  A buffer handle value is returned by a call to the DRV_SPI_BufferAddRead()/
26143  DRV_SPI_BufferAddWrite or DRV_SPI_BufferAddReadWrite() functions.
26144  This handle is associated with the buffer passed into the function and
26145  it allows the application to track the completion of the data from (or into)
26146  that buffer. The buffer handle value returned from the "buffer add" function
26147  is returned back to the client by the "callback" function registered with
26148  the driver.
26149  The buffer handle assigned to a client request expires when the client has
26150  been notified of the completion of the buffer transfer (after event handler
26151  function that notifies the client returns) or after the buffer has been
26152  retired by the driver if no event handler callback was set.
26153  Remarks:
26154  None.
26155 */
26156 
26157 typedef
26158 uintptr_t
26160 // *****************************************************************************
26161 /* SPI Driver Invalid Buffer Handle
26162  Summary:
26163  Definition of an invalid buffer handle.
26164  Description:
26165  This is the definition of an invalid buffer handle. An invalid buffer handle
26166  is returned by DRV_SPI_BufferAddRead() and DRV_SPI_BufferAddWrite()
26167  function if the buffer add request was not successful.
26168  Remarks:
26169  None.
26170 */
26171 #define DRV_SPI_BUFFER_HANDLE_INVALID ( ( DRV_SPI_BUFFER_HANDLE ) ( - 1 ) )
26172 // *****************************************************************************
26173 /* SPI Driver Module Index Numbers
26174  Summary:
26175  SPI driver index definitions.
26176  Description:
26177  These constants provide the SPI driver index definitions.
26178  Remarks:
26179  These constants should be used in place of hard-coded numeric literals.
26180  These values should be passed into the DRV_SPI_Initialize and
26181  DRV_SPI_Open functions to identify the driver instance in use.
26182 */
26183 #define DRV_SPI_INDEX_0 0
26184 #define DRV_SPI_INDEX_1 1
26185 #define DRV_SPI_INDEX_2 2
26186 #define DRV_SPI_INDEX_3 3
26187 #define DRV_SPI_INDEX_4 4
26188 #define DRV_SPI_INDEX_5 5
26189 // *****************************************************************************
26190 /* SPI Driver Module Index Count
26191  Summary:
26192  Number of valid SPI driver indices.
26193  Description:
26194  This constant identifies the number of valid SPI driver indices.
26195  Remarks:
26196  This constant should be used in place of hard-coded numeric literals.
26197  This value is derived from device-specific header files defined as part
26198  of the peripheral libraries.
26199 */
26200 #define DRV_SPI_INDEX_COUNT SPI_NUMBER_OF_MODULES
26201 // *****************************************************************************
26202 /* SPI Clock Mode Selection
26203  Summary:
26204  Identifies the various clock modes of the SPI module.
26205  Description:
26206  This enumeration identifies the various clock modes of the SPI module.
26207  Remarks:
26208  None.
26209 */
26210 
26211 typedef
26212  enum
26213  {
26214  /* SPI Clock Mode 0:
26215  - Idle State of the clock is Low
26216  - Serial Output Data (SDO) Changed on Rising Edge of the clock
26217  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26219  /*DOM-IGNORE-BEGIN*/
26220  = 0 /*DOM-IGNORE-END*/
26221  ,
26222  /* SPI Clock Mode 1:
26223  - Idle State of the clock is Low
26224  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26225  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26227  /*DOM-IGNORE-BEGIN*/
26228  = 1 /*DOM-IGNORE-END*/
26229  ,
26230  /* SPI Clock Mode 2:
26231  - Idle State of the clock is High
26232  - Serial Output Data (SDO) Changes on Falling Edge of the clock
26233  - Serial Input Data (SDI) Sampled on Rising Edge of the clock */
26235  /*DOM-IGNORE-BEGIN*/
26236  = 2 /*DOM-IGNORE-END*/
26237  ,
26238  /* SPI Clock Mode 3:
26239  - Idle State of the clock is High
26240  - Serial Output Data (SDO) Changes on Rising Edge of the clock
26241  - Serial Input Data (SDI) Sampled on Falling Edge of the clock */
26243  /*DOM-IGNORE-BEGIN*/
26244  = 3 /*DOM-IGNORE-END*/
26245  } DRV_SPI_CLOCK_MODE ;
26246 // *****************************************************************************
26247 /* SPI Buffer Type Selection
26248  Summary:
26249  Identifies the various buffer types of the SPI module.
26250  Description:
26251  This enumeration identifies the various buffer types of the SPI module.
26252  Remarks:
26253  None.
26254 */
26255 
26256 typedef
26257  enum
26258  {
26259  /* SPI Buffer Type Standard */
26261  /*DOM-IGNORE-BEGIN*/
26262  = 0 /*DOM-IGNORE-END*/
26263  ,
26264  /* SPI Enhanced Buffer Type */
26266  /*DOM-IGNORE-BEGIN*/
26267  = 1 /*DOM-IGNORE-END*/
26269 // *****************************************************************************
26270 /* SPI Protocols Enumeration
26271  Summary:
26272  Identifies the various protocols of the SPI module.
26273  Description:
26274  This enumeration identifies the various protocols of the SPI module.
26275  Remarks:
26276  None.
26277 */
26278 
26279 typedef
26280  enum
26281  {
26282  /* SPI Protocol Type Standard */
26284  /*DOM-IGNORE-BEGIN*/
26285  = 0 /*DOM-IGNORE-END*/
26286  ,
26287  /* SPI Protocol Type Framed */
26289  /*DOM-IGNORE-BEGIN*/
26290  = 1 /*DOM-IGNORE-END*/
26291  ,
26292  /*SPI Protocol Type Audio*/
26294  /*DOM-IGNORE-BEGIN*/
26295  = 2 /*DOM-IGNORE-END*/
26297 // *****************************************************************************
26298 /* SPI Driver Buffer Events
26299  Summary
26300  Identifies the possible events that can result from a buffer add request.
26301  Description
26302  This enumeration identifies the possible events that can result from a
26303  buffer add request caused by the client calling either
26304  DRV_SPI_BufferAddRead2 or DRV_SPI_BufferAddWrite2 or similar functions.
26305  Remarks:
26306  One of these values is passed in the "event" parameter of the event
26307  handling callback function that the client registered during buffer add
26308  requests.
26309 */
26310 
26311 typedef
26312  enum
26313  {
26314  /* Buffer is pending to get processed */
26316  /* Buffer is being processed */
26318  /* All data from or to the buffer was transferred successfully. */
26320  /* There was an error while processing the buffer transfer request. */
26323 // *****************************************************************************
26324 /* SPI Usage Modes Enumeration
26325  Summary:
26326  Identifies the various usage modes of the SPI module.
26327  Description:
26328  This enumeration identifies the various usage modes of the SPI module.
26329  Remarks:
26330  None.
26331 */
26332 
26333 typedef
26334  enum
26335  {
26336  /* SPI Mode Master */
26338  /*DOM-IGNORE-BEGIN*/
26339  = 0 /*DOM-IGNORE-END*/
26340  ,
26341  /* SPI Mode Slave */
26343  /*DOM-IGNORE-BEGIN*/
26344  = 1 /*DOM-IGNORE-END*/
26345  } DRV_SPI_MODE ;
26346 // *****************************************************************************
26347 /* SPI Task Modes Enumeration
26348  Summary:
26349  Identifies the various modes of how the tasks function will be run.
26350  Description:
26351  This enumeration identifies the various tasks mode
26352  Remarks:
26353  None.
26354 */
26355 
26356 typedef
26357  enum
26358  {
26359  /* Task is configured to run in polled mode */
26361  /*DOM-IGNORE-BEGIN*/
26362  = 0 /*DOM-IGNORE-END*/
26363  ,
26364  /* Task is configured to run in interrupt mode */
26366  /*DOM-IGNORE-BEGIN*/
26367  = 1 /*DOM-IGNORE-END*/
26368  } DRV_SPI_TASK_MODE ;
26369 // *****************************************************************************
26370 /* SPI Driver Buffer Event Handler Function Pointer
26371  Summary:
26372  Pointer to a SPI Driver Buffer Event handler function
26373  Description:
26374  This data type defines the required function signature for the SPI driver
26375  buffer event handling callback function. A client must register a pointer
26376  to a buffer event handling function who's function signature (parameter
26377  and return value types) match the types specified by this function pointer
26378  in order to receive buffer related event calls back from the driver.
26379  The parameters and return values and return value are described here and
26380  a partial example implementation is provided.
26381  Parameters:
26382  event - Identifies the type of event
26383  bufferHandle - Handle identifying the buffer to which the vent relates
26384  context - Value identifying the context of the application that
26385  registered the event handling function.
26386  Returns:
26387  None.
26388  Example:
26389  <code>
26390  void APP_MyBufferEventHandler( DRV_SPI_BUFFER_EVENT event,
26391  DRV_SPI_BUFFER_HANDLE bufferHandle,
26392  uintptr_t context )
26393  {
26394  MY_APP_DATA_STRUCT pAppData = (MY_APP_DATA_STRUCT) context;
26395  switch(event)
26396  {
26397  case DRV_SPI_BUFFER_EVENT_COMPLETE:
26398  // Handle the completed buffer.
26399  break;
26400  case DRV_SPI_BUFFER_EVENT_ERROR:
26401  default:
26402  // Handle error.
26403  break;
26404  }
26405  }
26406  </code>
26407  Remarks:
26408  If the event is DRV_SPI_BUFFER_EVENT_COMPLETE, it means that the data was
26409  transferred successfully.
26410  If the event is DRV_SPI_BUFFER_EVENT_ERROR, it means that the data was
26411  not transferred successfully.
26412  The bufferHandle parameter contains the buffer handle of the buffer that
26413  failed.
26414  The context parameter contains the a handle to the client context,
26415  provided at the time the event handling function registration.
26416  This context handle value is passed back to the client as the "context"
26417  parameter. It can be any value necessary to identify the client context
26418  or instance (such as a pointer to the client's data) instance of the
26419  client that made the buffer add request.
26420  The event handler function executes in an interrupt context when the driver
26421  is configured for interrupt mode operation. It is recommended of the
26422  application to not perform process intensive operations with in this
26423  function.
26424 */
26425 
26426 typedef
26428 DRV_SPI_BUFFER_HANDLE bufferHandle ,
26429 void * context ) ;
26430 // *****************************************************************************
26431 /* SPI Driver Initialization Data
26432  Summary:
26433  Defines the data required to initialize or reinitialize the SPI driver
26434  Description:
26435  This data type defines the data required to initialize or reinitialize the
26436  SPI driver. If the driver is built statically, the members of this data
26437  structure are statically over-ridden by static override definitions in the
26438  system_config.h file.
26439  Remarks:
26440  None.
26441 */
26442 
26443 typedef
26444 struct _DRV_SPI_INIT
26445 {
26446  /* System module initialization */
26447  SYS_MODULE_INIT moduleInit ;
26448  /* Identifies peripheral (PLIB-level) ID */
26449  SPI_MODULE_ID spiId ;
26450  /* SPI Task Mode Type*/
26452  /* SPI Usage Mode Type */
26454  /* Allow SPI to run when CPU goes to idle mode*/
26455  bool allowIdleRun ;
26456  /* SPI Protocol Type */
26458  /* SPI Slave Mode SSx Pin Select */
26459  bool spiSlaveSSPin ;
26460  /* Framed mode Sync Pulse*/
26461  SPI_FRAME_SYNC_PULSE frameSyncPulse ;
26462  /* Framed Mode pulse polarity*/
26463  SPI_FRAME_PULSE_POLARITY framePulsePolarity ;
26464  /* Framed Mode Pulse Direction*/
26465  SPI_FRAME_PULSE_DIRECTION framePulseDirection ;
26466  /* Framed mode Pulse Edge*/
26467  SPI_FRAME_PULSE_EDGE framePulseEdge ;
26468  /* Framed Mode Pulse width */
26469  SPI_FRAME_PULSE_WIDTH framePulseWidth ;
26470  /* Audio mode transmit mode*/
26471  SPI_AUDIO_TRANSMIT_MODE audioTransmitMode ;
26472  /* Audio mode protocol mode*/
26473  SPI_AUDIO_PROTOCOL audioProtocolMode ;
26474  /* Communication Width */
26475  SPI_COMMUNICATION_WIDTH commWidth ;
26476  /* SPI clock source which generates required baud rate.
26477  It can be either PBCLK or Reference Clock */
26478  SPI_BAUD_RATE_CLOCK baudClockSource ;
26479  /* when Baud rate clock source is peripheral clock, then this element is
26480  used to define which peripheral bus clock is used for this particular
26481  SPI instance. */
26482  CLK_BUSES_PERIPHERAL spiClk ;
26483  /* Baud Rate Value */
26484  uint32_t baudRate ;
26485  /* SPI Buffer Type */
26487  /* SPI Clock mode */
26489  /* SPI Input Sample Phase Selection */
26490  SPI_INPUT_SAMPLING_PHASE inputSamplePhase ;
26491  /* Transmit/Receive or Transmit Interrupt Source for SPI module */
26492  INT_SOURCE txInterruptSource ;
26493  /* Receive Interrupt Source for SPI module */
26494  INT_SOURCE rxInterruptSource ;
26495  /* Error Interrupt Source for SPI module */
26496  INT_SOURCE errInterruptSource ;
26497  /* While using standard buffer and polled mode how many transfers to do
26498  before yielding to other tasks*/
26499  uint8_t numTrfsSmPolled ;
26500  /* Dummy byte value which will be used for dummy transmission */
26501  uint32_t dummyByteValue ;
26502  /* This is the buffer queue size. This is the maximum
26503  number of transfer requests that driver will queue. */
26504  uint8_t queueSize ;
26505  /* This controls the minimum number of jobs that the driver will be able
26506  to accept without running out of memory. The driver will reserve this
26507  number of jobs from the global SPI queue so that it will always be available*/
26508  uint8_t jobQueueReserveSize ;
26509  /* This callback is fired when an operation is about to start on the
26510  SPI bus. This allows the user to set any pins that need to be set.
26511  This callback may be called from an ISR so should not include OSAL
26512  calls. The context parameter is the same one passed into the
26513  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26514  */
26516  /* This callback is fired when an operation has just completed on the
26517  SPI bus. This allows the user to set any pins that need to be set.
26518  This callback may be called from an ISR so should not include OSAL
26519  calls. The context parameter is the same one passed into the
26520  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26521  */
26523 } DRV_SPI_INIT ;
26524 // *****************************************************************************
26525 /* SPI Driver Client Specific Configuration
26526  Summary:
26527  Defines the data that can be changed per client.
26528  Description:
26529  This data type defines the data can be configured per client. This data can
26530  be per client, and overrides the configuration data contained inside of
26531  DRV_SPI_INIT.
26532  Remarks:
26533  None.
26534 */
26535 
26536 typedef
26537 struct _DRV_SPI_CLIENT_DATA
26538 {
26539  /* Baud Rate Value */
26540  uint32_t baudRate ;
26541  /* This callback is fired when an operation is about to start on the
26542  SPI bus. This allows the user to set any pins that need to be set.
26543  This callback may be called from an ISR so should not include OSAL
26544  calls. The context parameter is the same one passed into the
26545  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26546  */
26548  /* This callback is fired when an operation has just completed on the
26549  SPI bus. This allows the user to set any pins that need to be set.
26550  This callback may be called from an ISR so should not include OSAL
26551  calls. The context parameter is the same one passed into the
26552  BufferAddRead, BufferAddWrite, BufferAddWriteRead function.
26553  */
26556 //DOM-IGNORE-BEGIN
26557 //DOM-IGNORE-END
26558  // #ifndef _DRV_SPI_DEFINITIONS_H
26559 /*******************************************************************************
26560  End of File
26561 */
26562 
26563 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi_definitions.h*/
26564 /* CLOSE_FILE Include File */
26565 
26566 // DOM-IGNORE-BEGIN
26567 // DOM-IGNORE-END
26568 // *****************************************************************************
26569 // *****************************************************************************
26570 // Section: Interface Routines - System Level
26571 // *****************************************************************************
26572 // *****************************************************************************
26573 // *****************************************************************************
26574 /* Function:
26575  SYS_MODULE_OBJ DRV_SPI_Initialize( const SYS_MODULE_INDEX index,
26576  const SYS_MODULE_INIT * const init )
26577  Summary:
26578  Initializes the SPI instance for the specified driver index.
26579  <p><b>Implementation:</b> Static/Dynamic</p>
26580  Description:
26581  This routine initializes the SPI driver instance for the specified driver
26582  index, making it ready for clients to open and use it. The initialization
26583  data is specified by the 'init' parameter. The initialization may fail if the
26584  number of driver objects allocated are insufficient or if the specified
26585  driver instance is already initialized. The driver instance index is
26586  independent of the SPI module ID. For example, driver instance 0 can be
26587  assigned to SPI2. If the driver is built statically, then some of the
26588  initialization parameters are overridden by configuration macros. Refer to
26589  the description of the DRV_SPI_INIT data structure for more details on
26590  which members on this data structure are overridden.
26591  Precondition:
26592  None.
26593  Parameters:
26594  index - Identifier for the instance to be initialized. Please note this
26595  is not the SPI id. The hardware SPI id is set in the initialization
26596  structure. This is the index of the driver index to use.
26597  init - Pointer to a data structure containing any data necessary to
26598  initialize the driver. If this pointer is NULL, the driver
26599  uses the static initialization override macros for each
26600  member of the initialization data structure.
26601  Returns:
26602  - If successful - returns a valid handle to a driver instance object
26603  - If unsuccessful - returns SYS_MODULE_OBJ_INVALID
26604  Example:
26605  <code>
26606  DRV_SPI_INIT init;
26607  SYS_MODULE_OBJ objectHandle;
26608  // Populate the SPI initialization structure
26609  init.spiId = SPI_ID_1,
26610  init.taskMode = DRV_SPI_TASK_MODE_ISR,
26611  init.spiMode = DRV_SPI_MODE_MASTER,
26612  init.allowIdleRun = false,
26613  init.spiProtocolType = DRV_SPI_PROTOCOL_TYPE_STANDARD,
26614  init.commWidth = SPI_COMMUNICATION_WIDTH_8BITS,
26615  init.baudClockSource = SPI_BAUD_RATE_PBCLK_CLOCK;
26616  init.spiClk = CLK_BUS_PERIPHERAL_2,
26617  init.baudRate = 10000000,
26618  init.bufferType = DRV_SPI_BUFFER_TYPE_ENHANCED,
26619  init.clockMode = DRV_SPI_CLOCK_MODE_IDLE_LOW_EDGE_FALL,
26620  init.inputSamplePhase = SPI_INPUT_SAMPLING_PHASE_IN_MIDDLE,
26621  init.txInterruptSource = INT_SOURCE_SPI_1_TRANSMIT,
26622  init.rxInterruptSource = INT_SOURCE_SPI_1_RECEIVE,
26623  init.errInterruptSource = INT_SOURCE_SPI_1_ERROR,
26624  init.dummyByteValue = 0xFF,
26625  init.queueSize = 10,
26626  init.jobQueueReserveSize = 1,
26627  objectHandle = DRV_SPI_Initialize(DRV_SPI_INDEX_1, (SYS_MODULE_INIT*)usartInitData);
26628  if (SYS_MODULE_OBJ_INVALID == objectHandle)
26629  {
26630  // Handle error
26631  }
26632  </code>
26633  Remarks:
26634  This routine must be called before any other SPI routine is called.
26635  This routine should only be called once during system initialization
26636  unless DRV_SPI_Deinitialize is called to deinitialize the driver
26637  instance. This routine will NEVER block for hardware access.
26638 */
26639 
26640 SYS_MODULE_OBJ
26642  const SYS_MODULE_INDEX index ,
26643  const SYS_MODULE_INIT * const init ) ;
26644 //*************************************************************************
26645 /* Function:
26646  void DRV_SPI_Deinitialize ( SYS_MODULE_OBJ object )
26647  Summary:
26648  Deinitializes the specified instance of the SPI driver module.
26649  <p><b>Implementation:</b> Static/Dynamic</p>
26650  Description:
26651  Deinitializes the specified instance of the SPI driver module,
26652  disabling its operation (and any hardware) and invalidates all of the
26653  internal data.
26654  Precondition:
26655  Function DRV_SPI_Initialize must have been called before calling this
26656  routine and a valid SYS_MODULE_OBJ must have been returned.
26657  Parameters:
26658  object - Driver object handle, returned from DRV_SPI_Initialize
26659  Returns:
26660  None.
26661  Example:
26662  <code>
26663  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26664  SYS_STATUS status;
26665  DRV_SPI_Deinitialize ( object );
26666  status = DRV_SPI_Status( object );
26667  if( SYS_MODULE_UNINITIALIZED == status )
26668  {
26669  // Check again later if you need to know
26670  // when the driver is deinitialized.
26671  }
26672  </code>
26673  Remarks:
26674  Once the Initialize operation has been called, the De-initialize
26675  operation must be called before the Initialize operation can be called
26676  again.
26677  This function will NEVER block waiting for hardware. If the operation
26678  requires time to allow the hardware to complete, this will be reported
26679  by the DRV_SPI_Status operation. The system has to use DRV_SPI_Status
26680  to find out when the module is in the ready state.
26681 */
26682 
26683 void
26685  SYS_MODULE_OBJ object ) ;
26686 //**************************************************************************
26687 /* Function:
26688  SYS_STATUS DRV_SPI_Status ( SYS_MODULE_OBJ object )
26689  Summary:
26690  Provides the current status of the SPI driver module.
26691  <p><b>Implementation:</b> Static/Dynamic</p>
26692  Description:
26693  This function provides the current status of the SPI driver module.
26694  Precondition:
26695  The DRV_SPI_Initialize function must have been called before calling
26696  this function.
26697  Parameters:
26698  object - Driver object handle, returned from DRV_SPI_Initialize
26699  Returns:
26700  - SYS_STATUS_READY - Indicates that the driver is busy with a previous
26701  system level operation and cannot start another
26702  Example:
26703  <code>
26704  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26705  SYS_STATUS status;
26706  status = DRV_SPI_Status( object );
26707  if( SYS_STATUS_READY != status )
26708  {
26709  // Handle error
26710  }
26711  </code>
26712  Remarks:
26713  Any value greater than SYS_STATUS_READY is also a normal running state
26714  in which the driver is ready to accept new operations.
26715  SYS_MODULE_UNINITIALIZED - Indicates that the driver has been
26716  deinitialized
26717  This value is less than SYS_STATUS_ERROR.
26718  This function can be used to determine when any of the driver's module
26719  level operations has completed.
26720  If the status operation returns SYS_STATUS_BUSY, the previous operation
26721  has not yet completed. Once the status operation returns
26722  SYS_STATUS_READY, any previous operations have completed.
26723  The value of SYS_STATUS_ERROR is negative (-1). Any value less than
26724  that is also an error state.
26725  This function will NEVER block waiting for hardware.
26726  If the Status operation returns an error value, the error may be
26727  cleared by calling the reinitialize operation. If that fails, the
26728  deinitialize operation will need to be called, followed by the
26729  initialize operation to return to normal operations.
26730 */
26731 
26732 SYS_STATUS
26733  DRV_SPI_Status (
26734  SYS_MODULE_OBJ object ) ;
26735 // *****************************************************************************
26736 /* Function:
26737  void DRV_SPI_Tasks ( SYS_MODULE_OBJ object );
26738  Summary:
26739  Maintains the driver's state machine and implements its ISR.
26740  <p><b>Implementation:</b> Static/Dynamic</p>
26741  Description:
26742  This routine is used to maintain the driver's internal state
26743  machine and implement its transmit ISR for interrupt-driven implementations.
26744  In polling mode, this function should be called from the SYS_Tasks()
26745  function. In interrupt mode, this function should be called in the transmit
26746  interrupt service routine of the USART that is associated with this USART
26747  driver hardware instance.
26748  Precondition:
26749  The DRV_SPI_Initialize routine must have been called for the specified
26750  SPI driver instance.
26751  Parameters:
26752  object - Object handle for the specified driver instance (returned from
26753  DRV_SPI_Initialize)
26754  Returns:
26755  None.
26756  Example:
26757  <code>
26758  SYS_MODULE_OBJ object; // Returned from DRV_SPI_Initialize
26759  while( true )
26760  {
26761  DRV_SPI_Tasks ( object );
26762  // Do other tasks
26763  }
26764  </code>
26765  Remarks:
26766  This function is normally not called directly by an application. It is
26767  called by the system's Tasks routine (SYS_Tasks) or by the appropriate raw
26768  ISR.
26769  This function may execute in an ISR context and will never block or access any
26770  resources that may cause it to block.
26771 */
26772 
26773 void
26774  DRV_SPI_Tasks (
26775  SYS_MODULE_OBJ object ) ;
26776 // *****************************************************************************
26777 // *****************************************************************************
26778 // Section: Interface Routines - Client Level
26779 // *****************************************************************************
26780 // *****************************************************************************
26781 //**************************************************************************
26782 /* Function:
26783  DRV_HANDLE DRV_SPI_Open ( const SYS_MODULE_INDEX drvIndex,
26784  const DRV_IO_INTENT ioIntent )
26785  Summary:
26786  Opens the specified SPI driver instance and returns a handle to it.
26787  <p><b>Implementation:</b> Static/Dynamic</p>
26788  Description:
26789  This routine opens the specified SPI driver instance and provides a
26790  handle that must be provided to all other client-level operations to
26791  identify the caller and the instance of the driver. The ioIntent
26792  parameter defines how the client interacts with this driver instance.
26793  If ioIntent is DRV_IO_INTENT_READ, the client will only be read from
26794  the driver. If ioIntent is DRV_IO_INTENT_WRITE, the client will only be
26795  able to write to the driver. If the ioIntent in
26796  DRV_IO_INTENT_READWRITE, the client will be able to do both, read and
26797  write.
26798  Specifying a DRV_IO_INTENT_EXCLUSIVE will cause the driver to provide
26799  exclusive access to this client. The driver cannot be opened by any
26800  other client.
26801  Precondition:
26802  The DRV_SPI_Initialize function must have been called before calling
26803  this function.
26804  Parameters:
26805  drvIndex - Index of the driver initialized with DRV_SPI_Initialize().
26806  Please note this is not the SPI ID.
26807  ioIntent - Zero or more of the values from the enumeration
26808  DRV_IO_INTENT ORed together to indicate the intended use of
26809  the driver
26810  Returns:
26811  If successful, the routine returns a valid open-instance handle (a
26812  number identifying both the caller and the module instance).
26813  If an error occurs, the return value is DRV_HANDLE_INVALID. An error
26814  can occur when the following is true:
26815  * if the number of client objects allocated via
26816  DRV_SPI_INSTANCES_NUMBER is insufficient
26817  * if the client is trying to open the driver but driver has been
26818  opened exclusively by another client
26819  * if the driver hardware instance being opened is not initialized or
26820  is invalid
26821  Example:
26822  <code>
26823  DRV_HANDLE handle;
26824  handle = DRV_SPI_Open( DRV_SPI_INDEX_0, DRV_IO_INTENT_EXCLUSIVE );
26825  if( DRV_HANDLE_INVALID == handle )
26826  {
26827  // Unable to open the driver
26828  }
26829  </code>
26830  Remarks:
26831  The handle returned is valid until the DRV_SPI_Close routine is
26832  called. This routine will NEVER block waiting for hardware. If the
26833  requested intent flags are not supported, the routine will return
26834  DRV_HANDLE_INVALID. This function is thread safe in a RTOS application.
26835  It should not be called in an ISR.
26836 */
26837 
26838 DRV_HANDLE
26839  DRV_SPI_Open (
26840  const SYS_MODULE_INDEX drvIndex ,
26841  const DRV_IO_INTENT ioIntent ) ;
26842 //**************************************************************************
26843 /* Function:
26844  int32_t DRV_SPI_ClientConfigure ( DRV_HANDLE handle,
26845  const DRV_SPI_CLIENT_DATA * cfgData )
26846  Summary:
26847  Configures a SPI client with specific data.
26848  <p><b>Implementation:</b> Static/Dynamic</p>
26849  Description:
26850  This routine takes a DRV_SPI_CLIENT_DATA structure and sets client specific options.
26851  Whenever a new SPI job is started these values will be used. Passing in NULL will
26852  reset the client back to configuration parameters passed to driver initialization.
26853  A zero in any of the structure elements will reset that specific configuration back
26854  to the driver default.
26855  Precondition:
26856  The DRV_SPI_Open function must have been called before calling
26857  this function.
26858  Parameters:
26859  handle - handle of the client returned by DRV_SPI_Open.
26860  cfgData - Client-specific configuration data.
26861  Returns:
26862  - If successful - the routing will return greater than or equal to zero
26863  - If an error occurs - the return value is negative
26864 */
26865 
26866 int32_t
26868  DRV_HANDLE handle ,
26869  const DRV_SPI_CLIENT_DATA * cfgData ) ;
26870 // *****************************************************************************
26871 /* Function:
26872  void DRV_SPI_Close ( DRV_HANDLE handle )
26873  Summary:
26874  Closes an opened instance of the SPI driver.
26875  <p><b>Implementation:</b> Static/Dynamic</p>
26876  Description:
26877  This function closes an opened instance of the SPI driver, invalidating the
26878  handle.
26879  Precondition:
26880  The DRV_SPI_Initialize routine must have been called for the specified
26881  SPI driver instance.
26882  DRV_SPI_Open must have been called to obtain a valid opened device handle.
26883  Parameters:
26884  handle - A valid open-instance handle, returned from the driver's
26885  open routine
26886  Returns:
26887  None.
26888  Example:
26889  <code>
26890  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26891  DRV_SPI_Close ( handle );
26892  </code>
26893  Remarks:
26894  After calling this routine, the handle passed in "handle" must not be used
26895  with any of the remaining driver routines. A new handle must be obtained by
26896  calling DRV_SPI_Open before the caller may use the driver again. This
26897  function is thread safe in a RTOS application.
26898  Note:
26899  Usually there is no need for the driver client to verify that the Close
26900  operation has completed.
26901 */
26902 
26903 void
26904  DRV_SPI_Close (
26905  DRV_HANDLE handle ) ;
26906 // *****************************************************************************
26907 // *****************************************************************************
26908 // Section: Interface Routines - Client level Read & Write APIs
26909 // *****************************************************************************
26910 // *****************************************************************************
26911 /* These are non-blocking APIs. It doesn't wait until the operation gets
26912  finished. The actual operation will happen it the task routine. The status of
26913  this operation can be monitored using DRV_SPI_BufferStatus function. In
26914  polling mode, User must ensure that the code gets time to execute the task
26915  routine. */
26916 //*******************************************************************************
26917 /* Function:
26918  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead ( DRV_HANDLE handle, void *rxBuffer,
26919  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26920  void * context )
26921  Summary:
26922  Registers a buffer for a read operation. Actual transfer will happen in
26923  the Task function.
26924  <p><b>Implementation:</b> Static/Dynamic</p>
26925  Description:
26926  Registers a buffer for a read operation. Actual transfer will happen in
26927  the Task function. The status of this operation can be monitored using
26928  DRV_SPI_BufferStatus function. A optional callback can also be
26929  provided that will be called when the operation is complete.
26930  Precondition:
26931  The DRV_SPI_Initialize routine must have been called for the specified
26932  SPI driver instance.
26933  DRV_SPI_Open must have been called to obtain a valid opened device
26934  handle.
26935  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
26936  in the DRV_SPI_Open call.
26937  Parameters:
26938  handle - A valid open-instance handle, returned from the driver's
26939  open routine
26940  rxBuffer - The buffer to which the data should be written to.
26941  size - Number of bytes to be read from the SPI bus.
26942  completeCB - Pointer to a function to be called when this queued operation is complete.
26943  context - unused by the driver but this is passed to the callback when it is called.
26944  Returns:
26945  If the buffer add request is successful, a valid buffer handle is returned.
26946  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
26947  Example:
26948  <code>
26949  DRV_HANDLE handle; // Returned from DRV_SPI_Open
26950  char myBuffer[MY_BUFFER_SIZE], state = 0;
26951  DRV_SPI_BUFFER_HANDLE bufferHandle;
26952  switch ( state )
26953  {
26954  case 0:
26955  bufferHandle = DRV_SPI_BufferAddRead( handle, myBuffer, 10, NULL, NULL );
26956  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
26957  {
26958  state++;
26959  }
26960  break;
26961  case 1:
26962  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
26963  {
26964  state++;
26965  // All transmitter data has been sent successfully.
26966  }
26967  break;
26968  }
26969  </code>
26970  Remarks:
26971  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddRead2"
26972  instead of it.
26973  */
26974 
26977  DRV_HANDLE handle ,
26978  void * rxBuffer ,
26979  size_t size ,
26980  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
26981  void * context ) ;
26982 //*******************************************************************************
26983 /* Function:
26984  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite ( DRV_HANDLE handle, void *txBuffer,
26985  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
26986  void * context )
26987  Summary:
26988  Registers a buffer for a write operation. Actual transfer will happen
26989  in the Task function.
26990  <p><b>Implementation:</b> Static/Dynamic</p>
26991  Description:
26992  Registers a buffer for a write operation. Actual transfer will happen
26993  in the Task function. The status of this operation can be monitored
26994  using DRV_SPI_BufferStatus function. A optional callback can also be
26995  provided that will be called when the operation is complete.
26996  Precondition:
26997  The DRV_SPI_Initialize routine must have been called for the specified
26998  SPI driver instance.
26999  DRV_SPI_Open must have been called to obtain a valid opened device
27000  handle.
27001  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27002  in the DRV_SPI_Open call.
27003  Parameters:
27004  handle - A valid open-instance handle, returned from the driver's
27005  open routine
27006  txBuffer - The buffer which hold the data.
27007  size - Number of bytes to be written to the SPI bus.
27008  completeCB - Pointer to a function to be called when this queued operation is complete
27009  context - unused by the driver but this is passed to the callback when it is called
27010  Returns:
27011  If the buffer add request is successful, a valid buffer handle is returned.
27012  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27013  Example:
27014  <code>
27015  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27016  char myBuffer[MY_BUFFER_SIZE], state = 0;
27017  DRV_SPI_BUFFER_HANDLE bufferHandle;
27018  switch ( state )
27019  {
27020  case 0:
27021  bufferHandle = DRV_SPI_BufferAddWrite( handle, myBuffer, 10, NULL, NULL );
27022  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27023  {
27024  state++;
27025  }
27026  break;
27027  case 1:
27028  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27029  {
27030  state++;
27031  // All transmitter data has been sent successfully.
27032  }
27033  break;
27034  }
27035  </code>
27036  Remarks:
27037  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWrite2"
27038  instead of it.
27039 */
27040 
27043  DRV_HANDLE handle ,
27044  void * txBuffer ,
27045  size_t size ,
27046  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27047  void * context ) ;
27048 //*******************************************************************************
27049 /* Function:
27050  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead( DRV_HANDLE handle,
27051  void *txBuffer, void *rxBuffer, size_t size, )
27052  Summary:
27053  Registers a buffer for a read and write operation. Actual transfer will
27054  happen in the Task function.
27055  <p><b>Implementation:</b> Static/Dynamic</p>
27056  Description:
27057  Registers a buffer for a read and write operation. Actual transfer will
27058  happen in the Task function. The status of this operation can be
27059  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27060  provided that will be called when the operation is complete.
27061  Precondition:
27062  The DRV_SPI_Initialize routine must have been called for the specified
27063  SPI driver instance.
27064  DRV_SPI_Open must have been called to obtain a valid opened device
27065  handle.
27066  Parameters:
27067  handle - A valid open-instance handle, returned from the driver's
27068  open routine
27069  txBuffer - The buffer which hold the data.
27070  txSize - Number of bytes to be written to the SPI bus.
27071  rxBuffer - The buffer to which the data should be written to.
27072  rxSize - Number of bytes to be read from the SPI bus
27073  completeCB - Pointer to a function to be called when this queued operation is complete
27074  context - unused by the driver but this is passed to the callback when it is called
27075  Returns:
27076  If the buffer add request is successful, a valid buffer handle is returned.
27077  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27078  Example:
27079  <code>
27080  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27081  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27082  DRV_SPI_BUFFER_HANDLE bufferHandle;
27083  switch ( state )
27084  {
27085  case 0:
27086  bufferHandle = DRV_SPI_BufferAddWriteRead( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL );
27087  if(bufferHandle != DRV_SPI_BUFFER_HANDLE_INVALID )
27088  {
27089  state++;
27090  }
27091  break;
27092  case 1:
27093  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27094  {
27095  state++;
27096  // All transmitter data has been sent successfully.
27097  }
27098  break;
27099  }
27100  </code>
27101  Remarks:
27102  This API will be deprecated soon, so avoid using it. Use "DRV_SPI_BufferAddWriteRead2"
27103  instead of it.
27104 */
27105 
27108  DRV_HANDLE handle ,
27109  void * txBuffer ,
27110  size_t txSize ,
27111  void * rxBuffer ,
27112  size_t rxSize ,
27113  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27114  void * context ) ;
27115 //*******************************************************************************
27116 /* Function:
27117  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2 ( DRV_HANDLE handle, void *rxBuffer,
27118  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27119  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27120  Summary:
27121  Registers a buffer for a read operation. Actual transfer will happen in
27122  the Task function.
27123  <p><b>Implementation:</b> Static/Dynamic</p>
27124  Description:
27125  Registers a buffer for a read operation. Actual transfer will happen in
27126  the Task function. The status of this operation can be monitored using
27127  DRV_SPI_BufferStatus function. A optional callback can also be
27128  provided that will be called when the operation is complete.
27129  Precondition:
27130  The DRV_SPI_Initialize routine must have been called for the specified
27131  SPI driver instance.
27132  DRV_SPI_Open must have been called to obtain a valid opened device
27133  handle.
27134  DRV_IO_INTENT_READ or DRV_IO_INTENT_READWRITE must have been specified
27135  in the DRV_SPI_Open call.
27136  Parameters:
27137  handle - A valid open-instance handle, returned from the driver's
27138  open routine
27139  rxBuffer - The buffer to which the data should be written to.
27140  size - Number of bytes to be read from the SPI bus.
27141  completeCB - Pointer to a function to be called when this queued operation is complete
27142  context - unused by the driver but this is passed to the callback when it is called
27143  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27144  Returns:
27145  If the buffer add request is successful, a valid buffer handle is returned.
27146  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27147  Example:
27148  <code>
27149  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27150  char myBuffer[MY_BUFFER_SIZE], state = 0;
27151  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27152  switch ( state )
27153  {
27154  case 0:
27155  bufferHandle = DRV_SPI_BufferAddRead2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27156  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27157  {
27158  state++;
27159  }
27160  break;
27161  case 1:
27162  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27163  {
27164  state++;
27165  // All transmitter data has been sent successfully.
27166  }
27167  break;
27168  }
27169  </code>
27170  Remarks:
27171  None.
27172  */
27173 
27176  DRV_HANDLE handle ,
27177  void * rxBuffer ,
27178  size_t size ,
27179  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27180  void * context ,
27181  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27182 //*******************************************************************************
27183 /* Function:
27184  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2 ( DRV_HANDLE handle, void *txBuffer,
27185  size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27186  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27187  Summary:
27188  Registers a buffer for a write operation. Actual transfer will happen
27189  in the Task function.
27190  <p><b>Implementation:</b> Static/Dynamic</p>
27191  Description:
27192  Registers a buffer for a write operation. Actual transfer will happen
27193  in the Task function. The status of this operation can be monitored
27194  using DRV_SPI_BufferStatus function. A optional callback can also be
27195  provided that will be called when the operation is complete.
27196  Precondition:
27197  The DRV_SPI_Initialize routine must have been called for the specified
27198  SPI driver instance.
27199  DRV_SPI_Open must have been called to obtain a valid opened device
27200  handle.
27201  DRV_IO_INTENT_WRITE or DRV_IO_INTENT_READWRITE must have been specified
27202  in the DRV_SPI_Open call.
27203  Parameters:
27204  handle - A valid open-instance handle, returned from the driver's
27205  open routine
27206  txBuffer - The buffer which hold the data.
27207  size - Number of bytes to be written to the SPI bus.
27208  completeCB - Pointer to a function to be called when this queued operation is complete
27209  context - unused by the driver but this is passed to the callback when it is called
27210  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27211  Returns:
27212  If the buffer add request is successful, a valid buffer handle is returned.
27213  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27214  Example:
27215  <code>
27216  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27217  char myBuffer[MY_BUFFER_SIZE], state = 0;
27218  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27219  switch ( state )
27220  {
27221  case 0:
27222  bufferHandle = DRV_SPI_BufferAddWrite2( handle, myBuffer, 10, NULL, NULL, &bufferHandle2 );
27223  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27224  {
27225  state++;
27226  }
27227  break;
27228  case 1:
27229  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27230  {
27231  state++;
27232  // All transmitter data has been sent successfully.
27233  }
27234  break;
27235  }
27236  </code>
27237  Remarks:
27238  None.
27239 */
27240 
27243  DRV_HANDLE handle ,
27244  void * txBuffer ,
27245  size_t size ,
27246  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27247  void * context ,
27248  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27249 //*******************************************************************************
27250 /* Function:
27251  DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2( DRV_HANDLE handle,
27252  void *txBuffer, void *rxBuffer, size_t size,
27253  DRV_SPI_BUFFER_EVENT_HANDLER completeCB,
27254  void * context, DRV_SPI_BUFFER_HANDLE * jobHandle )
27255  Summary:
27256  Registers a buffer for a read and write operation. Actual transfer will
27257  happen in the Task function.
27258  <p><b>Implementation:</b> Static/Dynamic</p>
27259  Description:
27260  Registers a buffer for a read and write operation. Actual transfer will
27261  happen in the Task function. The status of this operation can be
27262  monitored using DRV_SPI_BufferStatus function. A optional callback can also be
27263  provided that will be called when the operation is complete.
27264  Precondition:
27265  The DRV_SPI_Initialize routine must have been called for the specified
27266  SPI driver instance.
27267  DRV_SPI_Open must have been called to obtain a valid opened device
27268  handle.
27269  Parameters:
27270  handle - A valid open-instance handle, returned from the driver's
27271  open routine
27272  txBuffer - The buffer which hold the data.
27273  txSize - Number of bytes to be written to the SPI bus.
27274  rxBuffer - The buffer to which the data should be written to.
27275  rxSize - Number of bytes to be read from the SPI bus
27276  completeCB - Pointer to a function to be called when this queued operation is complete
27277  context - unused by the driver but this is passed to the callback when it is called
27278  jobHandle - pointer to the buffer handle, this will be set before the function returns and can be used in the ISR callback.
27279  Returns:
27280  If the buffer add request is successful, a valid buffer handle is returned.
27281  If request is not queued up, DRV_SPI_BUFFER_HANDLE_INVALID is returned.
27282  Example:
27283  <code>
27284  DRV_HANDLE handle; // Returned from DRV_SPI_Open
27285  char myReadBuffer[MY_BUFFER_SIZE], myWriteBuffer[MY_BUFFER_SIZE], state = 0;
27286  DRV_SPI_BUFFER_HANDLE bufferHandle, bufferHandle2;
27287  switch ( state )
27288  {
27289  case 0:
27290  bufferHandle = DRV_SPI_BufferAddWriteRead2( handle, myWriteBuffer, 10, myReadBuffer, 10, NULL, NULL, &bufferHandle2 );
27291  if(bufferHandle2 != DRV_SPI_BUFFER_HANDLE_INVALID )
27292  {
27293  state++;
27294  }
27295  break;
27296  case 1:
27297  if(DRV_SPI_BufferStatus(bufferHandle2) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27298  {
27299  state++;
27300  // All transmitter data has been sent successfully.
27301  }
27302  break;
27303  }
27304  </code>
27305  Remarks:
27306  None.
27307 */
27308 
27311  DRV_HANDLE handle ,
27312  void * txBuffer ,
27313  size_t txSize ,
27314  void * rxBuffer ,
27315  size_t rxSize ,
27316  DRV_SPI_BUFFER_EVENT_HANDLER completeCB ,
27317  void * context ,
27318  DRV_SPI_BUFFER_HANDLE * jobHandle ) ;
27319 // *****************************************************************************
27320 /* Function:
27321  DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus ( DRV_SPI_BUFFER_HANDLE bufferHandle )
27322  Summary:
27323  Returns the transmitter and receiver transfer status.
27324  <p><b>Implementation:</b> Static/Dynamic</p>
27325  Description:
27326  This returns the transmitter and receiver transfer status.
27327  Precondition:
27328  The DRV_SPI_Initialize routine must have been called for the specified
27329  SPI driver instance.
27330  DRV_SPI_Open must have been called to obtain a valid opened device handle.
27331  DRV_SPI_BufferAdd<Transfer> must have been called to obtain
27332  the buffer handle associated with that transfer.
27333  Parameters:
27334  bufferHandle - A valid buffer handle, returned from the driver's
27335  data transfer routine
27336  Returns:
27337  A DRV_SPI_BUFFER_STATUS value describing the current status of the
27338  transfer.
27339  Example:
27340  <code>
27341  // Buffer handle returned from the data transfer function
27342  DRV_SPI_BUFFER_HANDLE bufferHandle;
27343  if(DRV_SPI_BufferStatus(bufferHandle) == DRV_SPI_BUFFER_EVENT_COMPLETE)
27344  {
27345  // All transmitter data has been sent.
27346  }
27347  </code>
27348  Remarks:
27349  The returned status may contain a value with more than one of the bits
27350  specified in the DRV_SPI_BUFFER_STATUS enumeration set. The caller
27351  should perform an AND with the bit of interest and verify if the
27352  result is non-zero (as shown in the example) to verify the desired status
27353  bit.
27354 */
27355 
27358  DRV_SPI_BUFFER_HANDLE bufferHandle ) ;
27359 // *****************************************************************************
27360 /* Function:
27361  bool DRV_SPIn_ReceiverBufferIsFull(void)
27362  Summary:
27363  Returns the receive buffer status. 'n' represents the instance of the
27364  SPI driver used.
27365  <p><b>Implementation:</b> Static</p>
27366  Description:
27367  This function returns the receive buffer status (full/empty).
27368  Precondition:
27369  None.
27370  Parameters:
27371  None.
27372  Returns:
27373  Receive Buffer Status
27374  - 1 - Full
27375  - 0 - Empty
27376  Example:
27377  <code>
27378  bool rxBufStat;
27379  // Using instance 1 of SPI driver, that is n = 1
27380  rxBufStat = DRV_SPI1_ReceiverBufferIsFull();
27381  if (rxBufStat)
27382  {
27383  ...
27384  }
27385  </code>
27386  Remarks:
27387  None.
27388 */
27389 
27390 bool
27392 // *****************************************************************************
27393 /* Function:
27394  bool DRV_SPIn_TransmitterBufferIsFull(void)
27395  Summary:
27396  Returns the transmit buffer status. 'n' represents the instance of the
27397  SPI driver used.
27398  <p><b>Implementation:</b> Static</p>
27399  Description:
27400  This function returns the transmit buffer status (full/empty).
27401  Precondition:
27402  None.
27403  Parameters:
27404  None.
27405  Returns:
27406  Transmit Buffer Status
27407  - 1 - Full
27408  - 0 - Empty
27409  Example:
27410  <code>
27411  bool txBufStat;
27412  // Using instance 1 of SPI driver, that is n = 1
27413  txBufStat = DRV_SPI1_TransmitterBufferIsFull();
27414  if (txBufStat)
27415  {
27416  ...
27417  }
27418  </code>
27419  Remarks:
27420  None.
27421 */
27422 
27423 bool
27425 //DOM-IGNORE-BEGIN
27426 //DOM-IGNORE-END
27427  // #ifndef _DRV_SPI_H
27428 /*******************************************************************************
27429  End of File
27430 */
27431 
27432 #endif /*00 C:\microchip\harmony\v2_06\framework\driver\spi\drv_spi.h*/
27433 /* CLOSE_FILE Include File */
27434 
27435 #include "driver/usb/usbhs/drv_usbhs.h"
27436 #include "usb/usb_device.h"
27437 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h */
27438 /**************************************************************************************/
27439 /* LDRA_INSPECTED 110 S
27440 */
27456 /**************************************************************************************/
27457 #ifndef APP_H /* Guard against multiple inclusion.*/
27458 #define APP_H
27459 /**************************************************************************************/
27460 /* ************************************************************************************/
27461 /* Section: Included Files */
27462 /**************************************************************************************/
27463 /**************************************************************************************/
27464 #include <stdint.h>
27465 /**************************************************************************************/
27466 /**************************************************************************************/
27467 /* Section: Data Types */
27468 /**************************************************************************************/
27469 /**************************************************************************************/
27470 /**************************************************************************************/
27471 /* APP_DATA
27472  Summary:
27473  Holds APP_DATA used for the APP tasks.
27474  Description:
27475  Holds APP_DATA used for the APP tasks. The variables
27476  used are stored here.
27477  Remarks:
27478  None
27479  */
27480 
27481 typedef
27482  struct
27483  {
27484  uint8_t RevNumber ;
27485  } APP_DATA ;
27486 
27487 extern APP_DATA
27488  APP ;
27489 /**************************************************************************************/
27490 /**************************************************************************************/
27491 /* Section: Application Initialization and State Machine Functions */
27492 /**************************************************************************************/
27493 /**************************************************************************************/
27494 /*!*************************************************************************************
27495  Function:
27496  void APP_Initialize(void)
27497  Summary:
27498  Autonomous tool application initialization routine.
27499  Description:
27500  This function initializes the application. It places the
27501  application in its initial state and prepares it to run so that its
27502  APP_Tasks function can be called.
27503  Precondition:
27504  All other system initialization routines should be called before calling
27505  this routine (in "SYS_Initialize").
27506  Parameters:
27507  None.
27508  Returns:
27509  None.
27510  Example:
27511  APP_Initialize()
27512  Remarks:
27513  This routine must be called from the main function.
27514 */
27515 
27516 void
27517  APP_Initialize ( void ) ;
27518 /*!*************************************************************************************
27519  Function:
27520  void APP_Tasks(void)
27521  Summary:
27522  Application tasks function
27523  Description:
27524  This function is the main application's tasks function. It contains the various
27525  tasks that are maintained during the operation of the shooting panel.
27526  Precondition:
27527  The system ("SYS_Initialize") and application ("APP_Initialize") initialization
27528  should be called before calling this.
27529  Parameters:
27530  None.
27531  Returns:
27532  None.
27533  Example:
27534  APP_Tasks()
27535  Remarks:
27536  This routine must be called from the main() routine.
27537  */
27538 
27539 void
27540  APP_Tasks ( void ) ;
27541  /* APP_H */
27542 /***************************************************************************************
27543  End of File
27544  */
27545 
27546 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\app.h*/
27547 /* CLOSE_FILE Include File */
27548 
27549 // DOM-IGNORE-BEGIN
27550 // DOM-IGNORE-END
27551 // *****************************************************************************
27552 // *****************************************************************************
27553 // Section: Type Definitions
27554 // *****************************************************************************
27555 // *****************************************************************************
27556 // *****************************************************************************
27557 /* System Objects
27558  Summary:
27559  Structure holding the system's object handles
27560  Description:
27561  This structure contains the object handles for all objects in the
27562  MPLAB Harmony project's system configuration.
27563  Remarks:
27564  These handles are returned from the "Initialize" functions for each module
27565  and must be passed into the "Tasks" function for each module.
27566 */
27567 
27568 typedef
27569  struct
27570  {
27571  SYS_MODULE_OBJ sysTmr ;
27572  SYS_MODULE_OBJ drvTmr0 ;
27573  SYS_MODULE_OBJ drvTmr1 ;
27574  SYS_MODULE_OBJ drvTmr2 ;
27575  SYS_MODULE_OBJ drvTmr3 ;
27576  SYS_MODULE_OBJ drvTmr4 ;
27577  SYS_MODULE_OBJ drvUsart0 ;
27578  SYS_MODULE_OBJ drvPMP0 ;
27579  /*** SPI Object for Index 0 ***/
27580  SYS_MODULE_OBJ spiObjectIdx0 ;
27581  /*** SPI Object for Index 1 ***/
27582  SYS_MODULE_OBJ spiObjectIdx1 ;
27583  /*** SPI Object for Index 2 ***/
27584  SYS_MODULE_OBJ spiObjectIdx2 ;
27585  SYS_MODULE_OBJ drvUSBObject ;
27586  SYS_MODULE_OBJ usbDevObject0 ;
27587  } SYSTEM_OBJECTS ;
27588 // *****************************************************************************
27589 // *****************************************************************************
27590 // Section: extern declarations
27591 // *****************************************************************************
27592 // *****************************************************************************
27593 
27594 extern SYSTEM_OBJECTS
27595  sysObj ;
27596 //DOM-IGNORE-BEGIN
27597 //DOM-IGNORE-END
27598  /* _SYS_DEFINITIONS_H */
27599 /*******************************************************************************
27600  End of File
27601 */
27602 
27603 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\system_config\default\system_definitions.h*/
27604 /* CLOSE_FILE Include File */
27605 
27606 #include <stdbool.h>
27607 /**************************************************************************************/
27608 /**************************************************************************************/
27609 /* Section: Defines */
27610 /**************************************************************************************/
27611 /**************************************************************************************/
27612  /* A brief description of a section can be given directly below the section
27613  banner.
27614  */
27615 #define NEGATIVE_OFFSET 0x02U
27616 #define POS_HIGH_OFFSET 0x01U
27617 #define POS_LOW_OFFSET 0x03U
27618 #define DEFAULT_OFFSET 0x04U
27619 #define I_ARRAY_SIZE 50U
27620 
27621 typedef
27622 float
27624 /**************************************************************************************/
27625 /**************************************************************************************/
27626 /* Section: Data Types */
27627 /**************************************************************************************/
27628 /**************************************************************************************/
27629 /**************************************************************************************/
27630 /* WL_SPS_STATES
27631  Summary:
27632  WL_SPS_STATES enumeration
27633  Description:
27634  This enumeration defines the valid WL_SPS states. These states
27635  determine the behavior of the WL_SPS state machine at various times.
27636 */
27637 
27638 typedef
27639  enum
27640  {
27648  } WL_SPS_STATES ;
27649 /**************************************************************************************/
27650 /* WL_SPS_DATA
27651  Summary:
27652  Holds WL_SPS_DATA used for the WL_SPS tasks.
27653  Description:
27654  Holds WL_SPS_DATA used for the WL_SPS tasks. The state machine and variables
27655  used to control WL_SPS functions are stored here.
27656  Remarks:
27657  None
27658  */
27659 
27660 typedef
27661  struct
27662  {
27663  WL_SPS_STATES state ;
27664  DRV_HANDLE drvICHandle ;
27665  uint16_t voltage ;
27666  uint16_t voltage_limit ;
27667  uint16_t upper_voltage_limit ;
27668  uint16_t volt_count ;
27669  uint16_t current ;
27670  uint16_t max_current ;
27671  uint16_t current_limit ;
27672  uint16_t upper_current_limit ;
27673  uint8_t over_current_count ;
27674  uint8_t array_sum_count ;
27675  uint8_t array_count ;
27676  uint16_t offset ;
27677  int16_t i_array [ 50U ] ;
27678  int16_t i_sum ;
27679  bool new_current_values_flag ;
27680  bool new_voltage_values_flag ;
27681  bool overcurrent_flag ;
27682  bool overvoltage_flag ;
27683  uint16_t sensor_offset ;
27684  uint16_t sensor_constant ;
27685  bool sensor_offset_tick ;
27686  uint16_t v_array [ 50 ] ;
27687  uint16_t v_array_count ;
27688  uint32_t v_sum ;
27689  float32_t v_avg ;
27690  bool tick ;
27691  uint8_t no_count ;
27692  bool array_full ;
27693  uint8_t overvoltage_count ;
27694  } WL_SPS_DATA ;
27695 
27696 extern WL_SPS_DATA
27697  WL_SPS ;
27698 /**************************************************************************************/
27699 /**************************************************************************************/
27700 /* Section: Interface Functions */
27701 /**************************************************************************************/
27702 /**************************************************************************************/
27703 /*!*************************************************************************************
27704  Function:
27705  void SET_WL_SPS_IOffset( uint8_t mode )
27706  Summary:
27707  This function sets the wire-line current offset based on external settings.
27708  Description:
27709  This function sets the wire-line current offset based on external settings.
27710 
27711  Precondition:
27712  None.
27713  Parameters:
27714  None.
27715  Returns
27716  None.
27717 
27718  Remarks:
27719  None.
27720 
27721  Example:
27722  SET_WL_SPS_IOffset( uint8_t mode )
27723  */
27724 
27725 void
27727  uint8_t mode ) ;
27728 /*!*************************************************************************************
27729  Function:
27730  void Set_WL_SPS_CurrentLimit(uint16_t value)
27731  Summary:
27732  This function sets the current limit for the wire-line shooting power
27733  supply (WL_SPS).
27734  Description:
27735  This function sets the current limit for the wire-line shooting power
27736  supply (WL_SPS) and ensures it it not greater than the upper current limit.
27737  If the value programmed is greater than the upper current limit, then the the
27738  current limit is set to the upper current limit value.
27739  This is used in the WL_SPS over current check.
27740 
27741  Precondition:
27742  None.
27743  Parameters:
27744  None.
27745  Returns
27746  None.
27747 
27748  Remarks:
27749  None.
27750 
27751  Example:
27752  Set_WL_SPS_CurrentLimit(uint16_t value)
27753  */
27754 
27755 void
27757  uint16_t value ) ;
27758 /**************************************************************************************/
27759 /**************************************************************************************/
27760 /* State Machine Functions */
27761 /**************************************************************************************/
27762 /**************************************************************************************/
27763 /*!*************************************************************************************
27764  Function:
27765  *
27766  void WL_SPS_Tasks(void)
27767  Summary:
27768  WL_SPS_Tasks function
27769  Description:
27770  This routine is the WL_SPS_Tasks function. It defines the WL_SPS_Tasks state
27771  machine and core logic. This machine is used to monitor the wire-line shooting
27772  power supply (WL_SPS) voltage and current and will set flags when those limits
27773  are exceeded. Those flags are monitored by the HV_PS machine and will turn the
27774  supply off if either of those flags are set.
27775  Precondition:
27776  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
27777  should be called before calling this.
27778  Parameters:
27779  None.
27780  Returns:
27781  None.
27782  Remarks:
27783  This routine must be called from the APP_Tasks() routine.
27784  Example:
27785  WL_SPS_Tasks()
27786  */
27787 
27788 void
27789  WL_SPS_Tasks ( void ) ;
27790  /* WL_SPS_H */
27791 /***************************************************************************************
27792  End of File
27793  */
27794 
27795 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\wl_sps.h*/
27796 /* CLOSE_FILE Include File */
27797 
27798 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.h */
27799 /**************************************************************************************/
27813 /**************************************************************************************/
27814 #ifndef ADC_H /* Guard against multiple inclusion.*/
27815 #define ADC_H
27816 /**************************************************************************************/
27817 /**************************************************************************************/
27818 /* Section: Included Files */
27819 /**************************************************************************************/
27820 /**************************************************************************************/
27821 #include <stdint.h>
27822 #include <stdbool.h>
27823 /**************************************************************************************/
27824 /**************************************************************************************/
27825 /* Section: Data Types */
27826 /**************************************************************************************/
27827 /**************************************************************************************/
27828 /**************************************************************************************/
27829 /* ADC states
27830  Summary:
27831  ADC states enumeration
27832  Description:
27833  This enumeration defines the valid ADC states. These states
27834  determine the behavior of the ADC state machine at various times.
27835 */
27836 
27837 typedef
27838  enum
27839  {
27844  } ADC_STATES ;
27845 /**************************************************************************************/
27846 /* ADC_DATA
27847  Summary:
27848  Holds ADC_DATA used for the ADC tasks.
27849  Description:
27850  Holds ADC_DATA used for the ADC tasks. The state machine and variables
27851  used to control ADC functions are stored here.
27852  Remarks:
27853  None
27854  */
27855 
27856 typedef
27857  struct /* This structure collects the variables and states required for these*/
27858  {
27859  /* functions to operate.*/
27860  ADC_STATES state ;
27861  uint16_t hvps_i ;
27862  uint16_t hvps_cont ;
27863  uint16_t wl_cps_i ;
27864  uint16_t wl_cps_v ;
27865  uint16_t wl_sps_i_cf ;
27866  uint16_t wl_sps_i ;
27867  bool tick ;
27868  bool ADCInt ;
27869  } ADC_DATA ;
27870 
27871 extern ADC_DATA
27872  ADC ;
27873 /**************************************************************************************/
27874 /**************************************************************************************/
27875 /* State Machine Functions */
27876 /**************************************************************************************/
27877 /**************************************************************************************/
27878 /*!*************************************************************************************
27879  Function:
27880  void ADC_Tasks(void)
27881  Summary:
27882  ADC tasks function
27883  Description:
27884  This routine is the ADC tasks function. It defines the ADC's state machine and
27885  core logic. This machine initializes the Timer and ADCs used to digitize signal
27886  inputs. Once the timer and ADCs are started, this machine is set to idle and the
27887  the updated ADC values are retrieved in the system interrupt routine.
27888  Precondition:
27889  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
27890  should be called before calling this.
27891  Parameters:
27892  None.
27893  Returns:
27894  None.
27895  Example:
27896  ADC_Tasks()
27897 
27898  Remarks:
27899  This routine must be called from the APP_Tasks() routine.
27900  */
27901 
27902 void
27903  ADC_Tasks ( void ) ;
27904  /* ADC_H */
27905 /***************************************************************************************
27906  End of File
27907  */
27908 
27909 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\adc.h*/
27910 /* CLOSE_FILE Include File */
27911 
27912 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\switches.h */
27913 /**************************************************************************************/
27929 /**************************************************************************************/
27930 #ifndef SWITCHES_H /* Guard against multiple inclusion.*/
27931 #define SWITCHES_H
27932 /**************************************************************************************/
27933 /**************************************************************************************/
27934 /* Section: Included Files */
27935 /**************************************************************************************/
27936 /**************************************************************************************/
27937 #include <stdint.h>
27938 #include <stdbool.h>
27939 /**************************************************************************************/
27940 /**************************************************************************************/
27941 /* Section: Defines */
27942 /**************************************************************************************/
27943 /**************************************************************************************/
27944 #define S3_NUM_OF_POSITIONS 5U
27945 #define S6_NUM_OF_POSITIONS 3U
27946 #define S4_NUM_OF_POSITIONS 2U
27947 #define S1_NUM_OF_POSITIONS 2U
27948 /**************************************************************************************/
27949 /**************************************************************************************/
27950 /* Section: Data Types */
27951 /**************************************************************************************/
27952 /**************************************************************************************/
27953 /**************************************************************************************/
27954 /* SWITCH states
27955  Summary:
27956  SWITCH states enumeration
27957  Description:
27958  This enumeration defines the valid SWITCH states. These states
27959  determine the behavior of the SWITCH state machine at various times.
27960 */
27961 
27962 typedef
27963  enum
27964  {
27971  } SWITCH_STATES ;
27972 /**************************************************************************************/
27973 /* SWITCH_DATA
27974  Summary:
27975  Holds SWITCH_DATA used for the SWITCH tasks.
27976  Description:
27977  Holds SWITCH_DATA used for the SWITCH tasks. The state machine and variables
27978  used to control SWITCH functions are stored here.
27979  Remarks:
27980  None
27981  */
27982 
27983 typedef
27984  struct
27985  {
27986  SWITCH_STATES state ;
27987  uint8_t knob_switch_S3 [ 5 ] ;
27988  uint8_t key_switch_S6 [ 3 ] ;
27989  uint8_t pol_switch_S4 [ 2 ] ;
27990  uint8_t dump_fire_switch_S7 ;
27991  uint8_t fire_switch_S1 [ 2 ] ;
27992  uint8_t hvps_switch_S5 ;
27993  bool S3_flag ;
27994  bool S6_flag ;
27995  bool S4_flag ;
27996  bool S1_flag ;
27997  uint16_t store_buffer [ 2 ] ;
27998  uint16_t settings ;
27999  uint8_t dump_fire_count ;
28000  bool debounce_flag ;
28001  bool debounce_tick ;
28002  uint8_t read_try ;
28003  } SWITCH_DATA ;
28004 
28005 extern SWITCH_DATA
28006  SWITCH ;
28007 /**************************************************************************************/
28008 /* S3_COMMAND
28009  Summary:
28010  S3_COMMAND enumeration
28011  Description:
28012  This enumeration defines the valid S3_COMMAND results. These states
28013  determine the behavior of the SWITCH state machine at various times.
28014 */
28015 
28016 typedef
28017  enum
28018  {
28024  } S3_COMMAND ;
28025 /**************************************************************************************/
28026 /* S4_COMMAND
28027  Summary:
28028  S4_COMMAND enumeration
28029  Description:
28030  This enumeration defines the valid S4_COMMAND results. These states
28031  determine the behavior of the SWITCH state machine at various times.
28032 */
28033 
28034 typedef
28035  enum
28036  {
28039  } S4_COMMAND ;
28040 /**************************************************************************************/
28041 /* S7_COMMAND
28042  Summary:
28043  S7_COMMAND enumeration
28044  Description:
28045  This enumeration defines the valid S7_COMMAND results. These states
28046  determine the behavior of the S7_SWITCH state machine at various times.
28047 */
28048 
28049 typedef
28050  enum
28051  {
28055  } S7_COMMAND ;
28056 /**************************************************************************************/
28057 /* S1_COMMAND
28058  Summary:
28059  S1_COMMAND enumeration
28060  Description:
28061  This enumeration defines the valid S1_COMMAND results. These states
28062  determine the behavior of the SWITCH state machine at various times.
28063 */
28064 
28065 typedef
28066  enum
28067  {
28070  } S1_COMMAND ;
28071 /**************************************************************************************/
28072 /* S5_COMMAND
28073  Summary:
28074  S5_COMMAND enumeration
28075  Description:
28076  This enumeration defines the valid S5_COMMAND results. These states
28077  determine the behavior of the S5_SWITCH state machine at various times.
28078 */
28079 
28080 typedef
28081  enum
28082  {
28085  } S5_COMMAND ;
28086 /**************************************************************************************/
28087 /* SWITCH_COMMAND
28088  Summary:
28089  Holds SWITCH_COMMAND data used for the SWITCH tasks.
28090  Description:
28091  Holds SWITCH_COMMAND data used for the SWITCH tasks. The state machine and variables
28092  used to control SWITCH_COMMAND functions are stored here.
28093  Remarks:
28094  None
28095  */
28096 
28097 typedef
28098  struct
28099  {
28100  S3_COMMAND S3_state ;
28101  S4_COMMAND S4_state ;
28102  S7_COMMAND S7_state ;
28103  S1_COMMAND S1_state ;
28104  S5_COMMAND S5_state ;
28105  bool dmpfire_flag ;
28106  bool dmpled_tick ;
28107  } SWITCH_COMMAND ;
28108 
28109 extern SWITCH_COMMAND
28110  SW_COM ;
28111 /**************************************************************************************/
28112 /**************************************************************************************/
28113 /* Section: Local Functions */
28114 /**************************************************************************************/
28115 /**************************************************************************************/
28116 /*!*************************************************************************************
28117  Function:
28118  static void read_switches(void)
28119  Summary:
28120  This function determines all of the switch positions.
28121  Description:
28122  This function determines all of the switch positions. It does this by
28123  monitoring all of a given switches lines and ensuring that only one line per
28124  switch is active. For switches with multiple positions, each position is put
28125  into an array. Only one location in a given array can be active or true.
28126  The switch locations are then passed on to be processed and
28127  converted into commands to actuate relays or other activity.
28128 
28129  Precondition:
28130  None.
28131  Parameters:
28132  None.
28133  Returns
28134  None.
28135 
28136  Remarks:
28137  None.
28138 
28139  Example:
28140  read_switches()
28141  */
28142 
28143 static void
28144  read_switches ( void ) ;
28145 /*!*************************************************************************************
28146  Function:
28147  static void process_switches(void)
28148  Summary:
28149  This function converts the front panel switch positions into commands.
28150  Description:
28151  This function converts the front panel switch positions into commands. It does
28152  this by converting a switch active array location into a command that can be
28153  executed. The commands from a switch are held as state machines.
28154 
28155  Precondition:
28156  None.
28157  Parameters:
28158  None.
28159  Returns
28160  None.
28161 
28162  Remarks:
28163  None.
28164 
28165  Example:
28166  process_switches()
28167  */
28168 
28169 static void
28170  process_switches ( void ) ;
28171 /*!*************************************************************************************
28172  Function:
28173  static void execute_switches(void)
28174  Summary:
28175  This function actuates relays based on the front panel switch position.
28176  Description:
28177  This function actuates relays based on the front panel switch position.
28178 
28179  Precondition:
28180  None.
28181  Parameters:
28182  None.
28183  Returns
28184  None.
28185 
28186  Remarks:
28187  None.
28188 
28189  Example:
28190  static void execute_switches()
28191  */
28192 
28193 static void
28194  execute_switches ( void ) ;
28195 /*!*************************************************************************************
28196  Function:
28197  static void store_switches(void)
28198  Summary:
28199  This function stores the switch positions to be transferred to the host.
28200  Description:
28201  This function stores the switch positions to be transferred to the host. The
28202  switch positions are transferred into two 8-bit array locations. This data can
28203  then be sent to the host when requested. No other actions occur with this data.
28204 
28205  Precondition:
28206  None.
28207  Parameters:
28208  None.
28209  Returns
28210  None.
28211 
28212  Remarks:
28213  None.
28214 
28215  Example:
28216  store_switches()
28217  */
28218 
28219 static void
28220  store_switches ( void ) ;
28221 /**************************************************************************************/
28222 /**************************************************************************************/
28223 /* State Machine Functions */
28224 /**************************************************************************************/
28225 /**************************************************************************************/
28226 /*!*************************************************************************************
28227  Function:
28228  void SWITCH_Tasks ( void )
28229  Summary:
28230  SWITCH_Tasks function
28231  Description:
28232  This routine is the SWITCH_Tasks function. It defines the SWITCH_Tasks state
28233  machine and core logic. This machine is used to monitor the front panel switches
28234  and perform the tasks as designated by the switches.
28235  Precondition:
28236  The system ("SYS_Initialize") and application ("APP_Initialize")initialization
28237  should be called before calling this.
28238  Parameters:
28239  None.
28240  Returns:
28241  None.
28242  Remarks:
28243  This routine must be called from the APP_Tasks() routine.
28244  Example:
28245  SWITCH_Task()
28246  */
28247 
28248 void
28249  SWITCH_Tasks ( void ) ;
28250  /* SWITCHES_H */
28251 /***************************************************************************************
28252  End of File
28253  */
28254 
28255 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\switches.h*/
28256 /* CLOSE_FILE Include File */
28257 
28258 /* OPEN FILE C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h */
28259 /**************************************************************************************/
28276 /**************************************************************************************/
28277 #ifndef STATUSST_H /* Guard against multiple inclusion */
28278 #define STATUSST_H
28279 /**************************************************************************************/
28280 /**************************************************************************************/
28281 /* Section: Included Files */
28282 /**************************************************************************************/
28283 /**************************************************************************************/
28284 #include <stdbool.h>
28285 #include <stdint.h>
28286 /*typedef unsigned char uchar8_t*/
28287 /**************************************************************************************/
28288 /**************************************************************************************/
28289 /* Section: Interface Functions */
28290 /**************************************************************************************/
28291 /**************************************************************************************/
28292 /*!*************************************************************************************
28293  Function:
28294  void Set_Status(uint8_t bitposn)
28295  Summary:
28296  This function sets the desired bit to a one in the PIB status register.
28297  Description:
28298  This function sets the desired bit to a one in the PIB status register. This is
28299  called by various functions to indicate a command result or switch setting.
28300 
28301  Precondition:
28302  None.
28303  Parameters:
28304  uint8_t bitposn - the desired bit position in the PIB status register.
28305  Returns
28306  None.
28307 
28308  Remarks:
28309  None.
28310 
28311  Example:
28312  Set_Status(6)
28313  */
28314 
28315 void
28316  Set_Status (
28317  uint8_t bitposn ) ;
28318 /*!*************************************************************************************
28319  Function:
28320  void Clear_Status(unsigned short bitposn)
28321  Summary:
28322  This function sets the desired bit to a zero in the PIB status register.
28323  Description:
28324  This function sets the desired bit to a zero in the PIB status register. This is
28325  called by various functions to indicate a command result or switch setting.
28326 
28327  Precondition:
28328  None.
28329  Parameters:
28330  uint8_t bitposn - the desired bit position in the PIB status register.
28331  Returns
28332  None.
28333 
28334  Remarks:
28335  None.
28336 
28337  Example:
28338  ClearStatus(7)
28339  */
28340 
28341 void
28342  Clear_Status (
28343  uint8_t bitposn ) ;
28344 /*!*************************************************************************************
28345  Function:
28346  void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1 )
28347  Summary:
28348  Function to prepare the protocol A response.
28349  Description:
28350  Function to prepare the protocol A response. The return message is seven bytes.
28351  the first byte is the command that was sent. the next two bytes are the PIB status
28352  register. The next three bytes can contain two - 12 bit data fields. The data is
28353  then transferred to the TxFifo. The CRC for the return message is calculated
28354  and placed in the last byte.
28355 
28356  Precondition:
28357  None.
28358  Parameters:
28359  uint8_t byte - The command byte.
28360  uint16_t data2 - a 12 bit data field.
28361  uint16_t data1 - 1 12 bit data field.
28362  Returns
28363  None.
28364 
28365  Remarks:
28366  None.
28367 
28368  Example:
28369  Prepare_Return_A(CMD.COMMAND[ 0 ], 0, 0)
28370  */
28371 
28372 void
28374  uint8_t byte ,
28375  uint16_t data2 ,
28376  uint16_t data1 ) ;
28377 /*!*************************************************************************************
28378  Function:
28379  void Prepare_Return_B(uint8_t byt[] )
28380  Summary:
28381  Function to prepare the protocol B response.
28382  Description:
28383  Function to prepare the protocol B response. The return message is seven bytes.
28384  the first byte is the command that was sent. the next two bytes are the PIB status
28385  register. The next three bytes can contain a 12 bit Switch status register,
28386  a four bit StateID and an 8 bit Switch ID. The data is then transferred to the
28387  TxFifo. The CRC for the return message is calculated and placed in the last byte.
28388 
28389  Precondition:
28390  None.
28391  Parameters:
28392  uint8_t byt[] - Three received bytes from a PerfSwitch.
28393  Returns
28394  None.
28395 
28396  Remarks:
28397  None.
28398 
28399  Example:
28400  Prepare_Return_B( MAN.msg )
28401  */
28402 
28403 void
28405  uint8_t byt [] ) ;
28406  /* STATUSST_H */
28407 /***************************************************************************************
28408  End of File
28409  */
28410 
28411 #endif /*00 C:\microchip\harmony\v2_06\apps\Panel_Interface_Board\firmware\src\statusst.h*/
28412 /* CLOSE_FILE Include File */
28413 
28414 #include <stdbool.h>
28415 #include <xc.h>
28416 #include <math.h>
28417 /**************************************************************************************/
28418 /**************************************************************************************/
28419 /* Section: Structure Data */
28420 /**************************************************************************************/
28421 /**************************************************************************************/
28422 /**************************************************************************************/
28423 /* WL_SPS Data
28424  Summary:
28425  These structures hold the required states and variables to perform the WL_SPS tasks.
28426  Description:
28427  These structures hold the required states and variables to perform the WL_SPS tasks.
28428  These are here to link these structures for use by the local functions.
28429 
28430  Remarks:
28431  These are defined in wl_sps.h
28432 */
28433 
28436 /**************************************************************************************/
28437 /**************************************************************************************/
28438 /* Section: State Machine Functions */
28439 /**************************************************************************************/
28440 /**************************************************************************************/
28441 /***************************************************************************************
28442  Function:
28443  void WL_SPS_Tasks ( void )
28444  Summary:
28445  This routine is the WL_SPS_Tasks function. It defines the (WL_SPS) state machine
28446  and core logic. This task monitors the wire-line voltage and current.
28447  Remarks:
28448  Refer to the wl_sps.h interface header for function usage details.
28449  */
28450 
28451 void
28452  WL_SPS_Tasks ( void )
28453  {
28454  int izzqqzz=((int)(bitmapstruct.element1 |= (1 << 28))); /* 37 */
28455  switch (
28456  ( ( int )( /* 29 */
28457  WL_SPS.state
28458  ))*
28459  ((bitmapstruct.element1 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 29) : 0)), 1 ) /* 19 */
28460  )
28461  {
28462  case WL_SPS_STATE_INIT :
28463  ((bitmapstruct.element1 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 30) : 0)), 1 ); /* 41 */
28464  {
28465  WL_SPS.upper_current_limit = 2000 ;
28466  /* Set to 2000mA. Corresponds to 3.75At.*/
28467  /* 1.5 amps for 4.5 seconds = 6.75At, 1.5/0.026 = 60 (average over VAR_ARRY3 )*/
28468  /* Instead of right shifting and loosing precision 60 * 45 = 2600.*/
28469  WL_SPS.current_limit = 1900 ; /* Set the initial current limit to 1900mA.*/
28470  WL_SPS.tick = false ;
28471  WL_SPS.i_sum = 0 ;/* Initialize current sum for over current check.*/
28472  WL_SPS.array_count = 0U ;/* Initialize array counter.*/
28473  WL_SPS.overcurrent_flag = false ; /* Initialize the overcurrent flag to false.*/
28474  WL_SPS.new_current_values_flag = false ; /* Initialize the new values available flag as false.*/
28475  WL_SPS.voltage_limit = 500 ;
28476  WL_SPS.upper_voltage_limit = 500 ; /* Maximum voltage limit (VDC)for wire-line shooting power supply.*/
28477  WL_SPS.sensor_constant = ( uint16_t ) ( rint (
28478  ( 3.3F /
28479  4096.0F ) * ( 1.3243F /
28480  0.066F ) /* Convert ADC reading to mA current. Convert to integer causes @ 1% error.(16).*/
28481  * 1000.0F * .650F ) ) ; /* 1.3243 is circuit gain. 0.066 is hall effect IC sensitivity. .650 is empirical correction.*/
28482  DRV_IC0_Start () ; /* Start the input capture instance 0 function to monitor the WL_SPS voltage.*/
28483  ( void ) DRV_TMR0_Start () ;/* Start the TIMER instance 0 in conjunction with the input capture function.*/
28484  WL_SPS.state = WL_SPS_SENSOR_OFFSET ; /* Move on to record the zero current sensor offset.*/
28485  WL_SPS.over_current_count = 0U ; /* Count the number of successive overcurrent readings.*/
28486  WL_SPS.array_full = false ; /* Flag to indicate voltage array is full. Can turn on overvoltage check.*/
28487  WL_SPS.overvoltage_count = 0U ; /* Initialize the overvoltage count.*/
28488  WL_SPS.sensor_offset = 0U ; /* Initialize the sensor offset.*/
28489  WL_SPS.sensor_offset_tick = false ; /* Initialize the sensor offset timer tick.*/
28490  }
28491  ((int)(bitmapstruct.element1 |= (1 << 31))); /* 16 */
28492  goto l128474 ;
28493  case WL_SPS_SENSOR_OFFSET :
28494  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 0) : 0)), 1 ); /* 41 */
28495  {
28496  if
28497  ( /* 50 */
28498  (
28499 
28500  ( /* 52 */
28501  (
28503  )
28504  ? (bitmapstruct.element2 |= (1 << 1 ), 1)
28505  : (bitmapstruct.element2 |= (1 << 2 ), 0) ) /* 54 */
28506  &&
28507  ( WL_SPS.sensor_offset_tick == true )
28508  ) /* If the knob switch is in the ARM position and the sensor*/
28509  ) /* 1 */
28510  {
28511  ((int)(bitmapstruct.element2 |= (1 << 3))); /* 1 */
28512  {
28513  /* offset one second timer has completed,*/
28514  /* The one second timer allows the readings to settle during initialization.*/
28515  if
28516  (
28517  ( WL_SPS.new_current_values_flag == true )
28518  ) /* and a new value is available,*/
28519  {
28520  ((int)(bitmapstruct.element2 |= (1 << 4))); /* 1 */
28521  {
28522  WL_SPS.sensor_offset = ADC.wl_sps_i ; /* First reading is the zero current sensor offset.*/
28523  WL_SPS.state = WL_SPS_STATE_READ_I ; /* Move on to read the WL_SPS current.*/
28524  WL_SPS.new_current_values_flag = false ; /* Reset the new current value flag.*/
28525  }
28526  } else ((int)(bitmapstruct.element2 |= (1 << 5))); /* 4 */
28527  }
28528  ((int)(bitmapstruct.element2 |= (1 << 6))); /* 3 */
28529  }
28530  else
28531  {
28532  ((int)(bitmapstruct.element2 |= (1 << 7))); /* 2 */
28533  {
28534  WL_SPS.sensor_offset_tick = false ; /* Reset the offset_timer tick.*/
28535  WL_SPS.state = WL_SPS_STATE_READ_V ; /* Go read the wire-line voltage.*/
28536  }
28537  }
28538  }
28539  ((int)(bitmapstruct.element2 |= (1 << 8))); /* 16 */
28540  goto l128474 ;
28541  case WL_SPS_STATE_READ_I :
28542  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 9) : 0)), 1 ); /* 41 */
28543  {
28544  if
28545  (
28547  ) /* If a new value is available, check*/
28548  {
28549  ((int)(bitmapstruct.element2 |= (1 << 10))); /* 1 */
28550  {
28551  if
28552  (
28554  ) /* if the ADC reading is greater than the zero current offset reading,*/
28555  {
28556  ((int)(bitmapstruct.element2 |= (1 << 11))); /* 1 */
28557  {
28558  WL_SPS.current = ADC.wl_sps_i - WL_SPS.sensor_offset ; /* Determine the counts for a positive current.*/
28559  }
28560  ((int)(bitmapstruct.element2 |= (1 << 12))); /* 3 */
28561  }
28562  else /* Otherwise,*/
28563  {
28564  ((int)(bitmapstruct.element2 |= (1 << 13))); /* 2 */
28565  {
28566  WL_SPS.current = WL_SPS.sensor_offset - ADC.wl_sps_i ; /* determine the counts for a negative current.*/
28567  }
28568  }
28570  /* Add the offset to the current reading.*/
28571  /* LDRA_INSPECTED 130 D
28572 */ /* Sensor_constant does not need to be checked.*/
28573  WL_SPS.current = WL_SPS.current * WL_SPS.sensor_constant ; /* Convert ADC counts to mA. The current is an absolute value. No polarity indication.*/
28574  if
28575  (
28577  ) /* Check for a maximum current reading.*/
28578  {
28579  ((int)(bitmapstruct.element2 |= (1 << 14))); /* 1 */
28580  {
28582  }
28583  } else ((int)(bitmapstruct.element2 |= (1 << 15))); /* 4 */
28584  WL_SPS.new_current_values_flag = false ; /* Reset the new current value flag.*/
28585  WL_SPS.state = WL_SPS_STATE_CHECK_OVERCURRENT ; /* Move on to the overcurrent check.*/
28586  }
28587  ((int)(bitmapstruct.element2 |= (1 << 16))); /* 3 */
28588  }
28589  else
28590  {
28591  ((int)(bitmapstruct.element2 |= (1 << 17))); /* 2 */
28592  {
28593  WL_SPS.state = WL_SPS_STATE_READ_V ; /* Go read the wire-line voltage.*/
28594  }
28595  }
28596  }
28597  ((int)(bitmapstruct.element2 |= (1 << 18))); /* 16 */
28598  goto l128474 ;
28600  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 19) : 0)), 1 ); /* 41 */
28601  {
28602  if
28603  (
28605  ) /* WL_SPS Current has exceeded current limit,*/
28606  {
28607  ((int)(bitmapstruct.element2 |= (1 << 20))); /* 1 */
28608  {
28609  WL_SPS.over_current_count ++ ; /* Increment occurrence count.*/
28610  if
28611  (
28613  ) /* If it exceeds limit 50 times in a row,*/
28614  {
28615  ((int)(bitmapstruct.element2 |= (1 << 21))); /* 1 */
28616  {
28617  WL_SPS.overcurrent_flag = true ;
28618  }
28619  } else ((int)(bitmapstruct.element2 |= (1 << 22))); /* 4 */
28620  }
28621  ((int)(bitmapstruct.element2 |= (1 << 23))); /* 3 */
28622  }
28623  else
28624  {
28625  ((int)(bitmapstruct.element2 |= (1 << 24))); /* 2 */
28626  {
28627  WL_SPS.overcurrent_flag = false ; /* Reset flag.*/
28628  WL_SPS.over_current_count = 0U ; /* Reset count.*/
28629  }
28630  }
28631  WL_SPS.state = WL_SPS_STATE_READ_V ; /* Go read the wire-line voltage.*/
28632  }
28633  ((int)(bitmapstruct.element2 |= (1 << 25))); /* 16 */
28634  goto l128474 ;
28635  case WL_SPS_STATE_READ_V :
28636  ((bitmapstruct.element2 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 26) : 0)), 1 ); /* 41 */
28637  /* This state monitors the WL_SPS voltage. It uses the input capture*/
28638  {
28639  /* function to capture the period of the VCO that monitors the wire-line*/
28640  /* voltage. The period is then converted into a voltage.*/
28641  if
28642  ( /* 50 */
28643  (
28644 
28645  ( /* 52 */
28646  (
28647  WL_SPS.tick == true
28648  )
28649  ? (bitmapstruct.element2 |= (1 << 27 ), 1)
28650  : (bitmapstruct.element2 |= (1 << 28 ), 0) ) /* 54 */
28651  &&
28652  ( WL_SPS.new_voltage_values_flag == true )
28653  ) /* If a new value is available,*/
28654  ) /* 1 */
28655  {
28656  ((int)(bitmapstruct.element2 |= (1 << 29))); /* 1 */
28657  {
28658  WL_SPS.tick = false ;
28659  WL_SPS.v_sum = 0U ;/* Initialize the array sum to 0.*/
28660  WL_SPS.v_array[ WL_SPS.array_count ] = WL_SPS.volt_count ;/* Update the array with the latest VCO count.*/
28661  WL_SPS.array_count ++ ; /* Increment the array counter.*/
28662  for
28663  (
28664  WL_SPS.array_sum_count = 0U
28665  ;
28666  ( /* 28 */
28667  WL_SPS.array_sum_count < ( 50U )
28668  ) /* 7 */
28669  ;
28670  ( /* 7 */
28672  , ((int)(bitmapstruct.element2 |= (1 << 30))) /* 27b */
28673  , ((int)(bitmapstruct.element2 |= (1 << 31)))) /* 27e */
28674  ) /* Running sum of the array values.*/
28675  {
28676  { /* 32 */
28677  int QZZZ = ((int)(bitmapstruct.element3 |= (1 << 0))); /* 32 */
28679  ((int)(bitmapstruct.element3 |= (1 << 1))); /* 6 */
28680  }
28681  }
28682  ((int)(bitmapstruct.element3 |= (1 << 2))); /* 5 */
28683  /* LDRA_INSPECTED 444 S
28684 */
28685  /* LDRA_INSPECTED 93 S
28686 */ /* Casting an integer to a float does not violate rule.*/
28687  WL_SPS.v_avg = ( float32_t ) ( WL_SPS.v_sum /
28688  50U ) ; /* Determine the average of the array values.*/
28689  if
28690  (
28691  WL_SPS.array_count > 50U
28692  ) /* If we have reached the end of the array,*/
28693  {
28694  ((int)(bitmapstruct.element3 |= (1 << 3))); /* 1 */
28695  {
28696  WL_SPS.array_full = true ; /* Array is full. Can turn on overvoltage check.*/
28697  WL_SPS.array_count = 0U ; /* reset the array counter.*/
28698  }
28699  } else ((int)(bitmapstruct.element3 |= (1 << 4))); /* 4 */
28700  WL_SPS.new_voltage_values_flag = false ; /* Reset the new voltage values flag.*/
28701  WL_SPS.v_avg = ( powf ( WL_SPS.v_avg , - 1.023 ) ) ;/* Curve fit algorithm from Excel to compensate for non-linear*/
28702  WL_SPS.voltage = ( uint16_t ) ( rint ( WL_SPS.v_avg * 778528 ) ) ;/* VCO output.*/
28703  }
28704  ((int)(bitmapstruct.element3 |= (1 << 5))); /* 3 */
28705  }
28706  else
28707  {
28708  ((int)(bitmapstruct.element3 |= (1 << 6))); /* 2 */
28709  {
28710  if
28711  ( /* 50 */
28712  (
28713 
28714  ( /* 52 */
28715  (
28716  WL_SPS.tick == true
28717  )
28718  ? (bitmapstruct.element3 |= (1 << 7 ), 1)
28719  : (bitmapstruct.element3 |= (1 << 8 ), 0) ) /* 54 */
28720  &&
28721  ( WL_SPS.new_voltage_values_flag == false )
28722  ) /* If we are not receiving voltage updates because the voltage is too low,*/
28723  ) /* 1 */
28724  {
28725  ((int)(bitmapstruct.element3 |= (1 << 9))); /* 1 */
28726  {/* wait a time to reset the calculated voltage to zero.*/
28727  WL_SPS.tick = false ;/* reset the 1mS Timer tick.*/
28728  if
28729  (
28730  WL_SPS.no_count > 250U
28731  ) /* If we have not received a updated voltage in 250mS,*/
28732  {
28733  ((int)(bitmapstruct.element3 |= (1 << 10))); /* 1 */
28734  {
28735  WL_SPS.voltage = 0U ;/* set the variable to zero.*/
28736  WL_SPS.no_count = 0U ;/* Reset the counter.*/
28737  }
28738  ((int)(bitmapstruct.element3 |= (1 << 11))); /* 3 */
28739  }
28740  else/* Otherwise,*/
28741  {
28742  ((int)(bitmapstruct.element3 |= (1 << 12))); /* 2 */
28743  {
28744  WL_SPS.no_count ++ ;/* increment the counter.*/
28745  }
28746  }
28747  }
28748  ((int)(bitmapstruct.element3 |= (1 << 13))); /* 3 */
28749  }
28750  else
28751  {
28752  ((int)(bitmapstruct.element3 |= (1 << 14))); /* 2 */
28753  {
28754  /*Comment.*/
28755  }
28756  }
28757  }
28758  }
28759  WL_SPS.state = WL_SPS_STATE_CHECK_OVERVOLTAGE ; /* Move on to check for an overvoltage condition.*/
28760  }
28761  ((int)(bitmapstruct.element3 |= (1 << 15))); /* 16 */
28762  goto l128474 ;
28764  ((bitmapstruct.element3 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 16) : 0)), 1 ); /* 41 */
28765  {
28766  if
28767  (
28768  WL_SPS.array_full == true
28769  )
28770  {
28771  ((int)(bitmapstruct.element3 |= (1 << 17))); /* 1 */
28772  {
28773  if
28774  (
28776  )
28777  {
28778  ((int)(bitmapstruct.element3 |= (1 << 18))); /* 1 */
28779  {
28780  WL_SPS.overvoltage_count ++ ; /* Increment occurrence count.*/
28781  if
28782  (
28784  ) /* If it exceeds limit 50 times in a row,*/
28785  {
28786  ((int)(bitmapstruct.element3 |= (1 << 19))); /* 1 */
28787  {
28788  PLIB_PORTS_PinSet ( PORTS_ID_0 , PORT_CHANNEL_J , PORTS_BIT_POS_10 ) ;
28789  WL_SPS.overvoltage_flag = true ; /* Set to true so HVPS can be turned off.*/
28790  Set_Status ( 3 ) ;/* Set status bit to indicate WL_SPS overvoltage.*/
28791  }
28792  } else ((int)(bitmapstruct.element3 |= (1 << 20))); /* 4 */
28793  }
28794  ((int)(bitmapstruct.element3 |= (1 << 21))); /* 3 */
28795  }
28796  else
28797  {
28798  ((int)(bitmapstruct.element3 |= (1 << 22))); /* 2 */
28799  {
28800  WL_SPS.overvoltage_flag = false ; /* Reset flag.*/
28801  WL_SPS.overvoltage_count = 0U ; /* Reset Count.*/
28802  }
28803  }
28804  }
28805  } else ((int)(bitmapstruct.element3 |= (1 << 23))); /* 4 */
28806  if
28807  ( /* 50 */
28808  (
28809 
28810  ( /* 52 */
28811  (
28813  )
28814  ? (bitmapstruct.element3 |= (1 << 24 ), 1)
28815  : (bitmapstruct.element3 |= (1 << 25 ), 0) ) /* 54 */
28816  &&
28817  ( WL_SPS.sensor_offset > 0U )
28818  ) /* If the knob switch is in the ARM mode and the sensor offset has been*/
28819  ) /* 1 */
28820  {
28821  ((int)(bitmapstruct.element3 |= (1 << 26))); /* 1 */
28822  { /* initialized,*/
28823  WL_SPS.state = WL_SPS_STATE_READ_I ; /* Move on to read another current.*/
28824  }
28825  ((int)(bitmapstruct.element3 |= (1 << 27))); /* 3 */
28826  }
28827  else
28828  {
28829  ((int)(bitmapstruct.element3 |= (1 << 28))); /* 2 */
28830  {
28831  if
28832  ( /* 50 */
28833  (
28834 
28835  ( /* 52 */
28836  (
28838  )
28839  ? (bitmapstruct.element3 |= (1 << 29 ), 1)
28840  : (bitmapstruct.element3 |= (1 << 30 ), 0) ) /* 54 */
28841  &&
28842  ( WL_SPS.sensor_offset == 0U )
28843  ) /* If the knob switch is in the ARM mode and the sensor offset has not*/
28844  ) /* 1 */
28845  {
28846  ((int)(bitmapstruct.element3 |= (1 << 31))); /* 1 */
28847  {/* been initialized,*/
28848  WL_SPS.sensor_offset_tick = false ;/* reset the timer tick.*/
28849  WL_SPS.state = WL_SPS_SENSOR_OFFSET ;/* Go determine the wire-line sensor offset.*/
28850  }
28851  ((int)(bitmapstruct.element4 |= (1 << 0))); /* 3 */
28852  }
28853  else/* Otherwise,*/
28854  {
28855  ((int)(bitmapstruct.element4 |= (1 << 1))); /* 2 */
28856  {
28857  WL_SPS.state = WL_SPS_STATE_READ_V ;/* go read the wire-line voltage.*/
28858  }
28859  }
28860  }
28861  }
28862  }
28863  ((int)(bitmapstruct.element4 |= (1 << 2))); /* 16 */
28864  goto l128474 ;
28865  default :
28866  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 3) : 0)), 1 ); /* 41 */
28867  {
28868  /*Comment.*/
28869  }
28870  ((int)(bitmapstruct.element4 |= (1 << 4))); /* 16 */
28871  goto l128474 ;
28872  }
28873 l128474 :
28874  ; /* 18 */
28875  ((int)(bitmapstruct.element4 |= (1 << 5))); /* 30 */
28876  wl_sps_50zqendz ( 134 ) ; /* 30 */
28877  }
28878 /**************************************************************************************/
28879 /**************************************************************************************/
28880 /* Section: Interface Functions */
28881 /**************************************************************************************/
28882 /**************************************************************************************/
28883 /*!*************************************************************************************
28884  Function:
28885  void Set_WL_SPS_CurrentLimit(uint16_t value)
28886  Summary:
28887  This function sets the current limit in mA for the wire-line shooting power
28888  supply (WL_SPS) and ensures it it not greater than the upper current limit.
28889  This is used in the WL_SPS over current check.
28890  Remarks:
28891  Refer to the wl_sps.h interface header for function usage details.
28892  */
28893 
28894 void
28896  uint16_t value )
28897  {
28898  int izzqqzz=((int)(bitmapstruct.element4 |= (1 << 6))); /* 37 */
28899  if
28900  (
28901  value > WL_SPS.upper_current_limit
28902  ) /* If the desired value is greater than the upper limit,*/
28903  {
28904  ((int)(bitmapstruct.element4 |= (1 << 7))); /* 1 */
28905  {
28906  WL_SPS.current_limit = WL_SPS.upper_current_limit ; /* set the current limit to the upper current limit.*/
28907  }
28908  ((int)(bitmapstruct.element4 |= (1 << 8))); /* 3 */
28909  }
28910  else /* Otherwise,*/
28911  {
28912  ((int)(bitmapstruct.element4 |= (1 << 9))); /* 2 */
28913  {
28914  WL_SPS.current_limit = value ; /* set the current limit to the desired value in mA.*/
28915  }
28916  }
28917  ((int)(bitmapstruct.element4 |= (1 << 10))); /* 30 */
28918  wl_sps_50zqendz ( 139 ) ; /* 30 */
28919  }
28920 /*!*************************************************************************************
28921  Function:
28922  void SET_WL_SPS_IOffset( unsigned char mode )
28923  Summary:
28924  This function set the WL_SPS offset value used in determining the final WL_SPS
28925  current value.
28926  Remarks:
28927  Refer to the wl_sps.h interface header for function usage details.
28928  */
28929 
28930 void
28932  uint8_t mode )
28933  {
28934  int izzqqzz=((int)(bitmapstruct.element4 |= (1 << 11))); /* 37 */
28935  switch (
28936  ( ( int )( /* 29 */
28937  mode
28938  ))*
28939  ((bitmapstruct.element4 |= ((( 1== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 12) : 0)), 1 ) /* 19 */
28940  )
28941  {
28942  case 0x01U :
28943  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 13) : 0)), 1 ); /* 41 */
28944  {
28945  /* spsIoffset = CalibrationData.spsIoffset*/
28946  }
28947  ((int)(bitmapstruct.element4 |= (1 << 14))); /* 16 */
28948  goto l128547 ;
28949  case 0x02U :
28950  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 15) : 0)), 1 ); /* 41 */
28951  /* Called from ARMCF mode*/
28952  {
28953  WL_SPS.offset = 2 ;
28954  }
28955  ((int)(bitmapstruct.element4 |= (1 << 16))); /* 16 */
28956  goto l128547 ;
28957  case 0x03U :
28958  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 17) : 0)), 1 ); /* 41 */
28959  {
28960  WL_SPS.offset = 3 ;
28961  }
28962  ((int)(bitmapstruct.element4 |= (1 << 18))); /* 16 */
28963  goto l128547 ;
28964  default :
28965  ((bitmapstruct.element4 |= ((( 0== 1)||(qqqzzglobflag == 1)) ? ( qqqzzglobflag ^= 1, 1 << 19) : 0)), 1 ); /* 41 */
28966  {
28967  WL_SPS.offset = 4 ;
28968  }
28969  ((int)(bitmapstruct.element4 |= (1 << 20))); /* 16 */
28970  goto l128547 ;
28971  }
28972 l128547 :
28973  ; /* 18 */
28974  ((int)(bitmapstruct.element4 |= (1 << 21))); /* 30 */
28975  wl_sps_50zqendz ( 150 ) ; /* 30 */
28976  }
28977 /***************************************************************************************
28978  End of File
28979  */
28980 #define qqqbranches 150
28981 #define QQQMAXMCDCSIZE 2
28982 /********************** LDRA_PORT INSTRUMENTATION **********************/
28983 
28984 /******************* END OF LDRA_PORT INSTRUMENTATION ******************/
28985 #define ldra_sscanf
28986  /* put in undefs to protect our parameter names from macros */
28987 #undef f
28988 #undef i
28989 #undef j
28990 #undef k
28991 #undef s
28992 #undef l
28993 #undef ii
28994 #undef some
28995 #undef none
28996 #undef from
28997 #undef a
28998 #undef b
28999 #undef iz
29000 #undef jz
29001 #undef qqnull_params
29002 #define qqnull_params void
29003  /* Conventional Instrumentation */
29004 #define qqzzidfield 1
29005  /* single file or fileid */
29006  /* these have an extra field for the fileid */
29007  static char qqqqone[] = "%6d\n"; /* single point */
29008  /* uncompressed data structures */
29009  /* uncompressed bitmap */
29010 #define QQQFIXEDSIZE
29011  static int qqqlast = 0;
29012  extern int qqupload_registered;
29013  extern int wl_sps_50zqqzqz(qqnull_params);
29014  extern int wl_sps_50zqqzqz1(qqnull_params);
29015  /* ----------------------------------------------------------------------* 200 *
29016  * Procedures
29017  * -----------------------------------------------------------------------------
29018  */
29019  /* ----------- zscanf ---------------------------------------------------* 201 *
29020  * Returns an integer extracted from a string
29021  * -----------------------------------------------------------------------------
29022  */
29023  static int wl_sps_50zscanf(char * qqscan_str)
29024  {
29025  int qqvalue;
29026  int qqisign;
29027  char * qqcptr;
29028  qqvalue = 0;
29029  qqisign = 1;
29030  qqcptr = qqscan_str;
29031  /* Skip spaces */
29032  while (qqcptr[0] == ' ')
29033  {
29034  qqcptr++;
29035  }
29036  /* Check for a leading ---
29037  */
29038  if (qqcptr[0] == '-')
29039  {
29040  qqisign = -1;
29041  qqcptr++;
29042  }
29043  /* Extract digits */
29044  while ((qqcptr[0] >= '0') && (qqcptr[0] <= '9'))
29045  {
29046  qqvalue = 10 * qqvalue;
29047  qqvalue = qqvalue + (qqcptr[0] - '0');
29048  qqcptr++;
29049  }
29050  qqvalue = qqisign * qqvalue;
29051  return qqvalue;
29052  } /* end of zscanf */
29053  /* ----------------------------------------------------------------------* 210 *
29054  * C System utilities in use:
29055  * fprintf
29056  * fclose
29057  * sscanf
29058  * -----------------------------------------------------------------------------
29059  */
29060  /* ----------------------------------------------------------------------* 213 *
29061  * qqoutput* suite
29062  * Main output routines. These may require modification.
29063  * -----------------------------------------------------------------------------
29064  */
29065  /* ----------------------------------------------------------------------* 214 *
29066  * qqoutput
29067  * This is the principle output routine.
29068  * -----------------------------------------------------------------------------
29069  */
29070  static void qqoutput(FILEPOINT char * s,int i)
29071  /* f - file pointer, s - format string, i - integer for probe value */
29072  {
29073  /* printing to a file */
29074  /* fprintf exists, not threaded */
29075  /* fprintf exists, not threaded, ( SINGLEFILE or FILEID ) */
29076  ldra_sprintf2 (&ldra_buffer[0], s,i,zzfileid);
29077  ldra_port_write (&ldra_buffer[0]);
29078  } /* end of qqoutput */
29079  /* ----------------------------------------------------------------------* 215 *
29080  * qqoutput0
29081  * -----------------------------------------------------------------------------
29082  */
29083  static void qqoutput0(FILEPOINT char * s)
29084  {
29085  ldra_port_write(s);
29086  } /* end of qqoutput0 */
29087  /* ----------------------------------------------------------------------* 216 *
29088  * qqoutput2
29089  * -----------------------------------------------------------------------------
29090  */
29091  static void qqoutput2(FILEPOINT char * s,int i, int j)
29092  {
29093  ldra_sprintf2 (&ldra_buffer[0], s, i, j);
29094  ldra_port_write (&ldra_buffer[0]);
29095  } /* end of qqoutput2 */
29096  /* ----------------------------------------------------------------------* 217 *
29097  * qqoutput3
29098  * -----------------------------------------------------------------------------
29099  */
29100  static void qqoutput3(FILEPOINT char * s,int i,int j,int k)
29101  {
29102  ldra_sprintf3 (&ldra_buffer[0], s, i, j, k);
29103  ldra_port_write (&ldra_buffer[0]);
29104  } /* end of qqoutput3 */
29105  /* ----------------------------------------------------------------------* 218 *
29106  * qqoutput4
29107  * -----------------------------------------------------------------------------
29108  */
29109  static void qqoutput4(FILEPOINT char * s,int i,int j,int k,int l)
29110  {
29111  ldra_sprintf4 (&ldra_buffer[0], s, i, j, k, l);
29112  ldra_port_write (&ldra_buffer[0]);
29113  } /* end of qqoutput4 */
29114  /* ----------------------------------------------------------------------* 219 *
29115  * end of qqoutput* suite
29116  * -----------------------------------------------------------------------------
29117  */
29118  /* ----------------------------------------------------------------------* 222 *
29119  * qqqqinitialise
29120  * This procedure initialises the structures for
29121  * compressed execution histories.
29122  * -----------------------------------------------------------------------------
29123  */
29124  static void qqqqinitialise(int ii)
29125  {
29126  unsigned int i;
29127  /* First time through. */
29128  /* bitmap */
29129  /* bitmap separate */
29130  qqqlast = 1; /* stops qqfun() calling initialise again */
29131  /* bitmap */
29132  /* bitmap singlefile */
29133  /* struct singlefile notmainfl */
29134  } /* end of qqqqinitialise */
29135 /* ----------------------------------------------------------------------* 225 *
29136 * qqqbitmapreset
29137 * This procedure resets the structures for
29138 * compressed execution histories.
29139 * -----------------------------------------------------------------------------
29140 */
29141 static void qqqbitmapreset()
29142 {
29143 struct bitmapstruct_t localbitmap = {0};
29144 bitmapstruct = localbitmap;
29145 } /* end of qqqbitmapreset */
29146 #undef QQQTEMP1
29147 #define QQQTEMP1
29148  /* ----------- zqqzqz ---------------------------------------------------* 310 *
29149  * -----------------------------------------------------------------------------
29150  */
29151  /* ----------------------------------------------------------------------* 312 *
29152  * This routine opens the execution history file. It is instrumented at the
29153  * start of the main program if one exists in the file. In general this is
29154  * superceded by wl_sps_50zqqzqz1 below.
29155  * -----------------------------------------------------------------------------
29156  */
29158  {
29159  if ( wl_sps_50zzopen != 1 )
29160  {
29161 #undef QQQMUSTOPEN
29162  wl_sps_50zzopen = 1;
29163  }
29164  return(1);
29165  } /* end of zqqzqz */
29166  /* ----------- zqqzqz1 --------------------------------------------------* 315 *
29167  * -----------------------------------------------------------------------------
29168  */
29169  /* ----------------------------------------------------------------------* 317 *
29170  * This routine also opens the execution history file. It is called
29171  * automatically if a probe fires and the execution history is not already
29172  * opened (wl_sps_50zzopen = 0 ).
29173  * Because this always works ( it was intended for files with no main program
29174  * it is now the de facto common way to open the execution history.
29175  * -----------------------------------------------------------------------------
29176  */
29178  {
29179  if ( wl_sps_50zzopen != 1 )
29180  {
29181  ldra_port_open(); /* 7 */
29182  qqqqinitialise(0);
29183  wl_sps_50zzopen = 1;
29184  }
29185  return(1);
29186  } /* end of zqqzqz1 */
29187  /* ----------- zqendz ---------------------------------------------------* 330 *
29188  * This routine is called on exiting a routine in a
29189  * module. It closes the execution history.
29190  * -----------------------------------------------------------------------------
29191  */
29192 static int wl_sps_50zqendz(int qqqi)
29193  {
29194  if (!qqqstructzzopen)
29195  {
29197  qqqstructzzopen = 1;
29198  }
29199  if ( wl_sps_50zzopen != 1 )
29200  {
29201  wl_sps_50zqqzqz1();
29202  }
29203  /* ----------------------------------------------------------------------* 331 *
29204  * this is the one which puts an integer into
29205  * the execution history file and returns unity.
29206  * The format of each field consists of six columns,
29207  * the number is right justified in this field.
29208  * -----------------------------------------------------------------------------
29209  */
29210  if ( wl_sps_50zzopen )
29211  {
29212  /* uncompressed */
29213  /* uncompressed unbuffered */
29214  /* uncompressed unbuffered bitmap */
29215  if ( qqqi > 0 )
29216  {
29217  }
29218  else
29219  {
29220  }
29221  }
29222  qqqlast = 0;
29223  return(1);
29224  } /* end of zqendz */
29225  /* ----------------------------------------------------------------------* 335 *
29226  * Output structure - qqbmsoutput
29227  * -----------------------------------------------------------------------------
29228  */
29229  static void qqbmsoutput(FILEPOINT char * s, unsigned int i)
29230  {
29231  static int branches_printed = 0;
29232  int b, last = 0;
29233  for(b=0;b<qqqqbmselwidth/8;b++)
29234  {
29235  ldra_sprintf1 (&ldra_buffer[0], s, (i >> last) & ~(~0 << 8));
29236  ldra_port_write (&ldra_buffer[0]);
29237  ldra_sprintf1 (&ldra_buffer[0], "%8d\n", zzfileid );
29238  ldra_port_write (&ldra_buffer[0]);
29239  last += 8;
29240  branches_printed += 8;
29241  if (branches_printed >= qqqbranches)
29242  {
29243  /* do not print any more, can be left over when using more than 8 bits to store bitmap */
29244  break;
29245  }
29246  }
29247  }
29248  /* ----------------------------------------------------------------------* 336 *
29249  * qqqupload
29250  * This routine loops through the stored bitmap and
29251  * outputs it. It then uploads the stored mcdc.
29252  * -----------------------------------------------------------------------------
29253  */
29254  static void qqqupload(qqnull_params)
29255  {
29256  int i;
29257  /* uncompressed bitmap (!singlefile or mainfl) separate */
29258  {
29259  wl_sps_50zqqzqz1();
29260 #define ELEMENT(N) qqbmsoutput("%8d", bitmapstruct.element##N);
29261 #define LASTELEMENT
29262 #include "wl_sps_50zbelem.def"
29263 #undef LASTELEMENT
29264 #undef ELEMENT
29265  }
29266  /* bitmap separate */
29267  qqqlast = 1; /* stops qqfun() calling initialise again */
29268  } /* end of qqqupload */
29269  /* ----------- zqzqzq ---------------------------------------------------* 342 *
29270  * -----------------------------------------------------------------------------
29271  */
29272  /* ----------------------------------------------------------------------* 344 *
29273  * This routine should be called before the program
29274  * terminates. It closes the execution history
29275  * -----------------------------------------------------------------------------
29276  */
29277  static int wl_sps_50zqzqzq(int qqqi)
29278  {
29279  if ( wl_sps_50zzopen != 1 )
29280  {
29281  wl_sps_50zqqzqz1();
29282  }
29283  /* not compressed */
29284  /* do nothing for bitmap*/
29285  /* upload the history */
29286  /* bitmap */
29287  /* uncompressed bitmap */
29288  wl_sps_50zqendz(qqqi);
29289  /* qqqupload closes the execution history file */
29290  return(1);
29291  } /* end of zqzqzq */
29292  /* the following routines should be left alone */
29293 /* END OF TESTBED INSTRUMENTATION */
29294 
#define QQQnumfil
Definition: inszt_wl_sps.c:51
void SYS_DMA_ChannelTransferEventHandlerSet(SYS_DMA_CHANNEL_HANDLE handle, const SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER eventHandler, const uintptr_t contextHandle)
S3_COMMAND
Definition: inszt_app.c:27690
uint8_t PLIB_USART_AddressMaskGet(USART_MODULE_ID index)
DRV_HANDLE DRV_USART_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
bool DRV_TMR2_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
uint16_t PLIB_DMA_ChannelXSourceSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_USART_LoopbackDisable(USART_MODULE_ID index)
void PLIB_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION outputFunction, PORTS_REMAP_OUTPUT_PIN remapOutputPin)
bool PLIB_DMA_ExistsBusy(DMA_MODULE_ID index)
S5_COMMAND
DRV_TMR_OPERATION_MODE DRV_TMR2_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
SPI_BAUD_RATE_CLOCK baudClockSource
Definition: inszt_adc.c:26566
bool DRV_TMR3_Start(void)
int qqupload_registered
Definition: inszt_main.c:6760
unsigned int DRV_USART_TransmitBufferSizeGet(const DRV_HANDLE handle)
DRV_CLIENT_STATUS
Definition: inszt_wl_sps.c:931
void PLIB_PORTS_ChangeNoticeInIdlePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool DRV_TMR0_Start(void)
bool PLIB_DMA_ExistsCRCBitOrder(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDestinationSize(DMA_MODULE_ID index)
void PLIB_USART_IrDAEnable(USART_MODULE_ID index)
void PLIB_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
void PLIB_USART_HandshakeModeSelect(USART_MODULE_ID index, USART_HANDSHAKE_MODE handshakeConfig)
void PLIB_SPI_BufferWrite16bit(SPI_MODULE_ID index, uint16_t data)
uint16_t PLIB_DMA_ChannelXPeripheralAddressGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXCellSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t CellSize)
bool PLIB_DMA_ChannelXNullWriteModeIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsReceiverAddressDetect(USART_MODULE_ID index)
void SYS_DEBUG_Reinitialize(SYS_MODULE_OBJ object, const SYS_MODULE_INIT *const init)
bool PLIB_PORTS_ExistsSlewRateControl(PORTS_MODULE_ID index)
void PLIB_USART_BaudRateHighEnable(USART_MODULE_ID index)
void DRV_USART0_WriteByte(const uint8_t byte)
DRV_TMR_OPERATION_MODE DRV_TMR3_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_SPI_AudioProtocolEnable(SPI_MODULE_ID index)
void SYS_PORTS_PinPullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_AddressSet(USART_MODULE_ID index, uint8_t address)
void PLIB_USART_LoopbackEnable(USART_MODULE_ID index)
void PLIB_SPI_ClockPolaritySelect(SPI_MODULE_ID index, SPI_CLOCK_POLARITY polarity)
uint8_t DRV_PMP0_Read(void)
void PLIB_USART_IrDADisable(USART_MODULE_ID index)
void DRV_USART_ByteErrorCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
PORTS_DATA_TYPE SYS_PORTS_InterruptStatusGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void Clear_Status(uint8_t bitposn)
bool PLIB_DMA_LastBusAccessIsRead(DMA_MODULE_ID index)
uint32_t PLIB_DMA_RecentAddressAccessed(DMA_MODULE_ID index)
void DRV_TMR_AlarmEnable(DRV_HANDLE handle, bool enable)
void PLIB_USART_TransmitterByteSend(USART_MODULE_ID index, int8_t data)
uint32_t DRV_TMR0_PeriodValueGet(void)
void DRV_USART_Close(const DRV_HANDLE handle)
bool PLIB_DMA_SuspendIsEnabled(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsDirection(PORTS_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePullUpPerPort(PORTS_MODULE_ID index)
SYS_MODULE_OBJ DRV_USART_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
uint8_t array_count
Definition: inszt_app.c:28462
DRV_TMR_CLIENT_STATUS DRV_TMR3_ClientStatus(void)
void PLIB_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
DMA_CRC_BYTE_ORDER PLIB_DMA_CRCByteOrderGet(DMA_MODULE_ID index)
void PLIB_USART_RunInSleepModeDisable(USART_MODULE_ID index)
uint16_t PORTS_DATA_MASK
Definition: inszt_adc.c:18519
void PLIB_SPI_AudioTransmitModeSelect(SPI_MODULE_ID index, SPI_AUDIO_TRANSMIT_MODE mode)
void PLIB_DMA_ChannelXINTSourceFlagSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_SPI_ExistsFrameSyncPulseDirection(SPI_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeEdgeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
bool PLIB_DMA_ChannelXBusyIsBusy(DMA_MODULE_ID index, DMA_CHANNEL channel)
SYS_DMA_SIDL
bool PLIB_USART_ExistsTransmitterEnable(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiverOverrunStatus(USART_MODULE_ID index)
SPI_FRAME_PULSE_POLARITY framePulsePolarity
Definition: inszt_adc.c:26551
DMA_CHANNEL_ADDRESSING_MODE PLIB_DMA_ChannelXAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_BaudRateAutoDetectIsComplete(USART_MODULE_ID index)
uint32_t DRV_TMR2_CounterValueGet(void)
#define wl_sps_50zqqzqz1
Definition: inszt_wl_sps.c:79
bool PLIB_DMA_ExistsAbortTransfer(DMA_MODULE_ID index)
void PLIB_USART_BaudRateHighDisable(USART_MODULE_ID index)
DMA_CHANNEL_INT_SOURCE PLIB_DMA_ChannelXTriggerSourceNumberGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
void SYS_DMA_ChannelAbortEventSet(SYS_DMA_CHANNEL_HANDLE handle, DMA_TRIGGER_SOURCE eventSrc)
bool PLIB_DMA_ExistsChannelXPatternLength(DMA_MODULE_ID index)
void DRV_TMR1_CounterClear(void)
bool PLIB_SPI_TransmitUnderRunStatusGet(SPI_MODULE_ID index)
float float32_t
Definition: cf.h:50
uint8_t array_sum_count
Definition: inszt_app.c:28461
void PLIB_DMA_CRCAppendModeEnable(DMA_MODULE_ID index)
SWITCH_DATA SWITCH
Definition: switches.c:59
void PLIB_PORTS_ChannelChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_PORTS_CnPinsPullUpEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void DRV_TMR3_CounterClear(void)
void PLIB_SPI_AudioProtocolDisable(SPI_MODULE_ID index)
void DRV_TMR3_CounterValueSet(uint32_t value)
uint32_t DRV_TMR1_PeriodValueGet(void)
bool PLIB_DMA_ExistsChannelXPatternIgnore(DMA_MODULE_ID index)
void PLIB_SPI_StopInIdleDisable(SPI_MODULE_ID index)
void DRV_TMR2_Initialize(void)
bool PLIB_PORTS_ExistsPinModePerPort(PORTS_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_SPI_ExistsBusStatus(SPI_MODULE_ID index)
void PLIB_USART_BaudRateAutoDetectEnable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXPatternIgnoreByteDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelBits(DMA_MODULE_ID index)
void PLIB_SPI_BaudRateSet(SPI_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
bool PLIB_USART_ExistsReceiverInterruptMode(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXTrigger(DMA_MODULE_ID index)
void PLIB_PORTS_DirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void SWITCH_Tasks(void)
DMA_DESTINATION_ADDRESSING_MODE PLIB_DMA_ChannelXDestinationAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
DRV_SPI_PROTOCOL_TYPE
Definition: inszt_adc.c:26367
bool PLIB_SPI_ExistsCommunicationWidth(SPI_MODULE_ID index)
static int qqqstructzzopen
Definition: inszt_wl_sps.c:137
DRV_USART_LINE_CONTROL_SET_RESULT
Definition: inszt_adc.c:15287
static unsigned char qqqzzglobflag
Definition: inszt_wl_sps.c:167
bool PLIB_USART_ExistsTransmitter(USART_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticePerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
static void DRV_TMR0_DeInitialize(void)
bool PLIB_SPI_ExistsBaudRateClock(SPI_MODULE_ID index)
void PLIB_USART_TransmitterIdleIsLowDisable(USART_MODULE_ID index)
static void store_switches(void)
SYS_MODULE_OBJ SYS_DEBUG_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void DRV_USART_TasksError(SYS_MODULE_OBJ object)
void DRV_PMP0_TimingSet(PMP_DATA_WAIT_STATES dataWait, PMP_STROBE_WAIT_STATES strobeWait, PMP_DATA_HOLD_STATES dataHold)
void PLIB_PORTS_DirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool DRV_SPIn_ReceiverBufferIsFull(void)
WL_SPS_STATES
Definition: inszt_app.c:28425
void DRV_USART_TasksReceive(SYS_MODULE_OBJ object)
void SYS_DEBUG_Tasks(SYS_MODULE_OBJ object)
bool PLIB_SPI_ExistsReceiveBufferStatus(SPI_MODULE_ID index)
void DRV_ADC_Initialize(void)
DRV_TMR_OPERATION_MODE DRV_TMR_OperationModeGet(DRV_HANDLE handle)
void PLIB_USART_BaudRateSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void PLIB_USART_WakeOnStartDisable(USART_MODULE_ID index)
uint16_t volt_count
Definition: inszt_app.c:28455
void PLIB_DMA_StopInIdleDisable(DMA_MODULE_ID index)
void PLIB_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_PORTS_PinModePerPortSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_MODE mode)
bool PLIB_USART_ExistsTransmitterInterruptMode(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiverAddressAutoDetect(USART_MODULE_ID index)
void SYS_PORTS_ChangeNotificationInIdleModeEnable(PORTS_MODULE_ID index)
void PLIB_USART_ReceiverAddressAutoDetectDisable(USART_MODULE_ID index)
DRV_USART_LINE_CONTROL
Definition: inszt_adc.c:15315
void DRV_ADC_Start(void)
DRV_USART_LINE_CONTROL
#define DRV_IC_Open(drvIndex, intent)
void DRV_USART_Deinitialize(SYS_MODULE_OBJ object)
void DRV_ADC_Stop(void)
DRV_USART_BAUD_SET_RESULT
Definition: inszt_adc.c:15266
DRV_HANDLE DRV_IC_Start(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT intent)
struct _DRV_SPI_CLIENT_DATA DRV_SPI_CLIENT_DATA
bool PLIB_DMA_ChannelXAutoIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXPatternDataSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t patternData)
void PLIB_DMA_ChannelXChainToLower(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsPinControl(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXDestinationStartAddress(DMA_MODULE_ID index)
bool PLIB_USART_ExistsBaudRateAutoDetect(USART_MODULE_ID index)
static void qqoutput4(FILEPOINT char *s, int i, int j, int k, int l)
static void DRV_TMR2_DeInitialize(void)
uint16_t voltage_limit
Definition: inszt_app.c:28453
uint32_t DRV_TMR4_PeriodValueGet(void)
void PLIB_DMA_ChannelXINTSourceEnable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
bool PLIB_USART_ExistsTransmitterBufferFullStatus(USART_MODULE_ID index)
void PLIB_SPI_FrameSyncPulseEdgeSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_EDGE edge)
bool PLIB_USART_ReceiverParityErrorHasOccurred(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXEvent(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNotice(PORTS_MODULE_ID index)
bool SYS_PORTS_PinLatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_PORTS_ExistsChangeNoticePullUp(PORTS_MODULE_ID index)
S7_COMMAND
Definition: inszt_app.c:27723
static SYS_STATUS DRV_TMR2_Status(void)
void PLIB_DMA_ChannelXChainDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ChannelXChainIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXDestinationStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t destinationStartAddress)
SYS_MODULE_OBJ DRV_TMR_Initialize(const SYS_MODULE_INDEX drvIndex, const SYS_MODULE_INIT *const init)
DRV_USART_ERROR DRV_USART_ErrorGet(const DRV_HANDLE client)
bool PLIB_PORTS_ExistsRemapOutput(PORTS_MODULE_ID index)
uint8_t jobQueueReserveSize
Definition: inszt_adc.c:26596
void SYS_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
DRV_TMR_CLIENT_STATUS
Definition: inszt_adc.c:1801
void PLIB_SPI_SlaveSelectEnable(SPI_MODULE_ID index)
void PLIB_USART_ReceiverEnable(USART_MODULE_ID index)
SYS_MODULE_INIT moduleInit
Definition: inszt_adc.c:26535
static void DRV_TMR2_Close(void)
bool PLIB_SPI_ExistsBuffer(SPI_MODULE_ID index)
void DRV_SPI_Close(DRV_HANDLE handle)
bool PLIB_USART_TransmitterBreakSendIsComplete(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXAuto(DMA_MODULE_ID index)
uintptr_t DRV_HANDLE
void PLIB_PORTS_ChannelChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool PLIB_USART_ReceiverOverrunHasOccurred(USART_MODULE_ID index)
bool DRV_ADC_SamplesAvailable(uint8_t bufIndex)
size_t DRV_USART_BufferProcessedSizeGet(DRV_USART_BUFFER_HANDLE bufferHandle)
bool PLIB_DMA_ChannelXTriggerIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
DRV_TMR_OPERATION_MODE DRV_TMR_DividerRangeGet(DRV_HANDLE handle, DRV_TMR_DIVIDER_RANGE *pDivRange)
DMA_TRANSFER_MODE PLIB_DMA_ChannelXOperatingTransferModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_StopInIdleDisable(USART_MODULE_ID index)
bool overcurrent_flag
Definition: inszt_app.c:28468
static void DRV_TMR0_Close(void)
void PLIB_DMA_CRCTypeSet(DMA_MODULE_ID index, DMA_CRC_TYPE CRCType)
static int qqqqbmselwidth
Definition: inszt_wl_sps.c:49
bool PLIB_PORTS_ExistsPinChangeNoticePerPort(PORTS_MODULE_ID index)
static SYS_STATUS DRV_TMR1_Status(void)
void PLIB_DMA_ChannelXPatternLengthSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_PATTERN_LENGTH patternLen)
void * PLIB_USART_ReceiverAddressGet(USART_MODULE_ID index)
bool DRV_TMR_Start(DRV_HANDLE handle)
bool PLIB_DMA_LastBusAccessIsWrite(DMA_MODULE_ID index)
static int qqqisinitialised
Definition: inszt_main.c:152
DRV_SPI_TASK_MODE
Definition: inszt_adc.c:26444
void PLIB_SPI_BufferClear(SPI_MODULE_ID index)
void SYS_DMA_ChannelTransferAdd(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
void PLIB_DMA_ChannelXChainEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
int16_t i_sum
Definition: inszt_app.c:28465
S3_COMMAND
PORTS_DATA_TYPE PLIB_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
bool PLIB_SPI_ExistsMasterControl(SPI_MODULE_ID index)
bool PLIB_PORTS_PinGetLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_DMA_ChannelXSourceAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_SOURCE_ADDRESSING_MODE sourceAddressMode)
void PLIB_SPI_BufferWrite(SPI_MODULE_ID index, uint8_t data)
void PLIB_DMA_Disable(DMA_MODULE_ID index)
bool PLIB_DMA_ChannelXReloadIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_StartTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void Prepare_Return_B(uint8_t byt [])
void SYS_PORTS_ChangeNotificationGlobalEnable(PORTS_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXPatternIgnoreByte(DMA_MODULE_ID index)
uint32_t DRV_TMR3_CounterFrequencyGet(void)
WL_SPS_STATES state
Definition: inszt_app.c:28450
bool PLIB_DMA_IsBusy(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsEnableControl(SPI_MODULE_ID index)
void SYS_DMA_Resume(void)
bool PLIB_SPI_ExistsFIFOInterruptMode(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortInIdle(PORTS_MODULE_ID index)
void PLIB_USART_Transmitter9BitsSend(USART_MODULE_ID index, int8_t data, bool Bit9th)
DMA_CHANNEL_DATA_SIZE PLIB_DMA_ChannelXDataSizeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint8_t over_current_count
Definition: inszt_app.c:28460
WL_SPS_STATES
bool PLIB_DMA_ChannelXEventIsDetected(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint16_t PLIB_SPI_BufferRead16bit(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXINTSourceIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void SYS_PORTS_PinSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
INT_SOURCE txInterruptSource
Definition: inszt_adc.c:26580
DRV_SPI_BUFFER_TYPE
Definition: inszt_adc.c:26344
bool PLIB_PORTS_ExistsChannelChangeNoticeMethod(PORTS_MODULE_ID index)
bool PLIB_SPI_Exists32bitBuffer(SPI_MODULE_ID index)
void PLIB_USART_TransmitterInterruptModeSelect(USART_MODULE_ID index, USART_TRANSMIT_INTR_MODE fifolevel)
static void execute_switches(void)
bool PLIB_SPI_ExistsTransmitBufferEmptyStatus(SPI_MODULE_ID index)
void SYS_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
static int qqqlast
void * PLIB_USART_TransmitterAddressGet(USART_MODULE_ID index)
uint32_t v_sum
Definition: inszt_app.c:28475
uint16_t PLIB_DMA_ChannelXPatternDataGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DRV_USART_BUFFER_RESULT DRV_USART_BufferRemove(DRV_USART_BUFFER_HANDLE bufferHandle)
bool PLIB_USART_ExistsTransmitter9BitsSend(USART_MODULE_ID index)
DRV_SPI_BUFFER_TYPE
#define qqnull_params
void PLIB_SPI_ReceiverOverflowClear(SPI_MODULE_ID index)
void DRV_TMR3_Initialize(void)
DRV_SPI_BUFFER_EVENT
Definition: inszt_adc.c:26399
bool PLIB_PORTS_ExistsChangeNoticeEdgeStatus(PORTS_MODULE_ID index)
DRV_USART_TRANSFER_STATUS
Definition: inszt_adc.c:15489
DRV_TMR_OPERATION_MODE
Definition: inszt_adc.c:1848
bool PLIB_USART_ExistsTransmitterBreak(USART_MODULE_ID index)
void DRV_PMP0_Write(uint8_t data)
bool PLIB_DMA_ExistsCRCAppendMode(DMA_MODULE_ID index)
void PLIB_DMA_CRCXOREnableSet(DMA_MODULE_ID index, uint32_t DMACRCXOREnableMask)
SYS_DMA_CHANNEL_IGNORE_MATCH
Definition: inszt_adc.c:13316
bool PLIB_DMA_ChannelXBufferedDataIsWritten(DMA_MODULE_ID index, DMA_CHANNEL channel)
SPI_FRAME_PULSE_DIRECTION framePulseDirection
Definition: inszt_adc.c:26553
void PLIB_PORTS_ChannelChangeNoticeEdgeDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK edgeRisingMask, PORTS_DATA_MASK edgeFallingMask)
void PLIB_SPI_PinEnable(SPI_MODULE_ID index, SPI_PIN pin)
SYS_ERROR_LEVEL gblErrLvl
void DRV_ADC0_Close(void)
unsigned int DRV_USART_ReceiverBufferSizeGet(const DRV_HANDLE handle)
static struct bitmapstruct_t bitmapstruct
void SYS_DMA_Tasks(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
TMR_PRESCALE DRV_TMR4_PrescalerGet(void)
bool PLIB_DMA_ExistsLastBusAccess(DMA_MODULE_ID index)
void DRV_USART_BufferAddRead(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *const bufferHandle, void *buffer, const size_t size)
SYS_DMA_ERROR
Definition: inszt_adc.c:13491
void PLIB_DMA_ChannelXTriggerDisable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
void PLIB_DMA_ChannelXTransferCountSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t transferCount)
void DRV_TMR0_StopInIdleEnable(void)
void DRV_TMR4_StopInIdleDisable(void)
bool PLIB_DMA_ExistsCRCXOREnable(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsCRCPolynomialLength(DMA_MODULE_ID index)
uint32_t dummyByteValue
Definition: inszt_adc.c:26589
void PLIB_SPI_SlaveEnable(SPI_MODULE_ID index)
void SYS_DMA_ChannelForceStart(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_DMA_ExistsChannelX(DMA_MODULE_ID index)
SYS_DMA_SIDL
Definition: inszt_adc.c:13275
DRV_USART_BAUD_SET_RESULT DRV_USART_BaudSet(const DRV_HANDLE client, uint32_t baud)
static char qqqqone[]
bool PLIB_USART_ExistsOperationMode(USART_MODULE_ID index)
void DRV_USART_ByteTransmitCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
bool PLIB_DMA_ExistsRecentAddress(DMA_MODULE_ID index)
bool DRV_TMR_GateModeClear(DRV_HANDLE handle)
uint16_t max_current
Definition: inszt_app.c:28457
uint32_t PORTS_DATA_TYPE
uint16_t PLIB_DMA_ChannelXDestinationPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
SYS_DMA_CHANNEL_CRC_MODE
Definition: inszt_adc.c:13335
PORTS_CHANGE_NOTICE_METHOD PLIB_PORTS_ChannelChangeNoticeMethodGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
PORTS_DATA_TYPE SYS_PORTS_LatchedGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_PORTS_ChangeNoticeInIdleEnable(PORTS_MODULE_ID index)
uintptr_t DRV_HANDLE
Definition: inszt_adc.c:1108
DRV_SPI_PROTOCOL_TYPE spiProtocolType
Definition: inszt_adc.c:26545
void PLIB_DMA_ChannelXOperatingTransferModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRANSFER_MODE channeltransferMode)
uint32_t DRV_TMR3_PeriodValueGet(void)
bool DRV_USART0_ReceiverBufferIsEmpty(void)
SPI_FRAME_PULSE_WIDTH framePulseWidth
Definition: inszt_adc.c:26557
uint32_t DRV_TMR_AlarmPeriodGet(DRV_HANDLE handle)
void PLIB_PORTS_CnPinsEnable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
void PLIB_SPI_FramedCommunicationEnable(SPI_MODULE_ID index)
uint16_t DRV_IC_Capture16BitDataRead(DRV_HANDLE handle)
uint8_t PLIB_DMA_ChannelXPatternIgnoreGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void(* DRV_USART_BYTE_EVENT_HANDLER)(const SYS_MODULE_INDEX index)
void PLIB_DMA_ChannelXReloadDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool SYS_PORTS_PinRead(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_PORTS_PinChangeNoticeEdgeIsEnabled(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_CHANGE_NOTICE_EDGE cnEdgeType)
void PLIB_USART_InitializeOperation(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE receiveInterruptMode, USART_TRANSMIT_INTR_MODE transmitInterruptMode, USART_OPERATION_MODE operationMode)
bool PLIB_USART_TransmitterBufferIsFull(USART_MODULE_ID index)
uint32_t baudRate
Definition: inszt_adc.c:26572
bool PLIB_SPI_ExistsFIFOShiftRegisterEmptyStatus(SPI_MODULE_ID index)
bool PLIB_DMA_ChannelXPatternIgnoreByteIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelXChainToHigher(DMA_MODULE_ID index, DMA_CHANNEL channel)
static void read_switches(void)
void PLIB_USART_ReceiverInterruptModeSelect(USART_MODULE_ID index, USART_RECEIVE_INTR_MODE interruptMode)
SYSTEM_OBJECTS sysObj
void SYS_PORTS_ChangeNotificationEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum, SYS_PORTS_PULLUP_PULLDOWN_STATUS value)
bool SYS_DMA_ChannelIsBusy(SYS_DMA_CHANNEL_HANDLE handle)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelXPriorityGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_IsEnabled(DMA_MODULE_ID index)
void DRV_TMR1_Initialize(void)
bool PLIB_USART_ExistsReceiver9Bits(USART_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_SuspendDisable(DMA_MODULE_ID index)
void PLIB_PORTS_AnPinsModeSelect(PORTS_MODULE_ID index, PORTS_AN_PIN anPins, PORTS_PIN_MODE mode)
bool PLIB_SPI_FIFOShiftRegisterIsEmpty(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_MODULE_OBJ DRV_USART0_Initialize(void)
TMR_PRESCALE DRV_TMR3_PrescalerGet(void)
void SYS_DMA_ChannelSetup(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OP_MODE modeEnable, DMA_TRIGGER_SOURCE eventSrc)
void PLIB_USART_BaudRateHighSet(USART_MODULE_ID index, uint32_t clockFrequency, uint32_t baudRate)
void PLIB_SPI_ErrorInterruptEnable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
void PLIB_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
bool PLIB_USART_ReceiverDataIsAvailable(USART_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXINTSourceFlag(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXBusy(DMA_MODULE_ID index)
static DRV_TMR_OPERATION_MODE DRV_TMR3_OperationModeGet(void)
void(* SYS_DMA_CHANNEL_TRANSFER_EVENT_HANDLER)(SYS_DMA_TRANSFER_EVENT event, SYS_DMA_CHANNEL_HANDLE handle, uintptr_t contextHandle)
void PLIB_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint16_t current_limit
Definition: inszt_app.c:28458
void PLIB_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION inputFunction, PORTS_REMAP_INPUT_PIN remapInputPin)
int QQQindicator
Definition: inszt_main.c:104
void SYS_PORTS_ChangeNotificationInIdleModeDisable(PORTS_MODULE_ID index)
bool PLIB_DMA_ChannelXIsEnabled(DMA_MODULE_ID index, DMA_CHANNEL channel)
S1_COMMAND
static void DRV_TMR4_DeInitialize(void)
bool PLIB_SPI_ExistsTransmitBufferFullStatus(SPI_MODULE_ID index)
DRV_SPI_MODE
SYS_PORTS_PIN_DIRECTION
Definition: inszt_adc.c:21888
DMA_PATTERN_LENGTH PLIB_DMA_ChannelXPatternLengthGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
TMR_PRESCALE DRV_TMR0_PrescalerGet(void)
ADC_STATES
bool PLIB_USART_ExistsReceiverAddressMask(USART_MODULE_ID index)
bool PLIB_USART_ExistsBaudRateHigh(USART_MODULE_ID index)
uint32_t DRV_TMR_CounterFrequencyGet(DRV_HANDLE handle)
bool PLIB_PORTS_ExistsLatchRead(PORTS_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseCounter(SPI_MODULE_ID index)
float float32_t
void DRV_TMR4_Stop(void)
SWITCH_COMMAND SW_COM
Definition: switches.c:61
void SYS_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_HANDLE DRV_USART0_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT ioIntent)
void DRV_IC0_Stop(void)
bool PLIB_SPI_ExistsFrameSyncPulseWidth(SPI_MODULE_ID index)
bool PLIB_DMA_ExistsChannelXChainEnbl(DMA_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void APP_Tasks(void)
Definition: app.c:130
uint8_t no_count
Definition: inszt_app.c:28478
uint32_t DRV_TMR3_CounterValueGet(void)
void DRV_TMR0_Stop(void)
bool PLIB_SPI_ReadDataIsSignExtended(SPI_MODULE_ID index)
DRV_USART_ERROR
bool PLIB_DMA_ExistsCRCByteOrder(DMA_MODULE_ID index)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
DMA_CHANNEL_TRANSFER_DIRECTION PLIB_DMA_ChannelXTransferDirectionGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void SYS_PORTS_RemapOutput(PORTS_MODULE_ID index, PORTS_REMAP_OUTPUT_FUNCTION function, PORTS_REMAP_OUTPUT_PIN remapPin)
bool PLIB_DMA_ExistsCRCChannel(DMA_MODULE_ID index)
uint32_t PLIB_USART_BaudRateGet(USART_MODULE_ID index, int32_t clockFrequency)
uint16_t PLIB_DMA_ChannelXCellSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void qqqtotalreset(void)
Definition: inszt_main.c:7067
DRV_USART_TRANSFER_STATUS DRV_USART0_TransferStatus(void)
void PLIB_DMA_ChannelXEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DMA_SOURCE_ADDRESSING_MODE PLIB_DMA_ChannelXSourceAddressModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_ChangeNoticePullDownPerPortEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_USART_TransmitterIdleIsLowEnable(USART_MODULE_ID index)
void PLIB_USART_OperationModeSelect(USART_MODULE_ID index, USART_OPERATION_MODE operationmode)
uint16_t PORTS_DATA_MASK
int QQQfcn_ptr_num
Definition: inszt_main.c:151
void DRV_IC0_Start(void)
bool PLIB_PORTS_PinGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_SPI_ExistsFramedCommunication(SPI_MODULE_ID index)
DRV_USART_HANDSHAKE
Definition: inszt_adc.c:15241
DRV_SPI_MODE
Definition: inszt_adc.c:26421
TMR_PRESCALE DRV_TMR_PrescalerGet(DRV_HANDLE handle)
struct _DRV_SPI_INIT DRV_SPI_INIT
void SYS_DMA_ChannelRelease(SYS_DMA_CHANNEL_HANDLE handle)
void PLIB_PORTS_ChangeNoticePerPortTurnOn(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_SPI_BUFFER_TYPE bufferType
Definition: inszt_adc.c:26574
DRV_TMR_OPERATION_MODE DRV_TMR1_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
void PLIB_USART_Enable(USART_MODULE_ID index)
void SYS_PORTS_RemapInput(PORTS_MODULE_ID index, PORTS_REMAP_INPUT_FUNCTION function, PORTS_REMAP_INPUT_PIN remapPin)
void SYS_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
void PLIB_DMA_ChannelXTriggerEnable(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRIGGER_TYPE trigger)
bool DRV_USART_TransmitBufferIsFull(const DRV_HANDLE handle)
bool PLIB_DMA_ExistsSuspend(DMA_MODULE_ID index)
bool PLIB_USART_ExistsReceiverFramingErrorStatus(USART_MODULE_ID index)
void DRV_USART0_Deinitialize(void)
uint32_t PLIB_DMA_CRCDataRead(DMA_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeInIdleDisable(PORTS_MODULE_ID index)
void PLIB_SPI_FIFODisable(SPI_MODULE_ID index)
bool PLIB_USART_TransmitterIsEmpty(USART_MODULE_ID index)
void PLIB_PORTS_PinChangeNoticeEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
static void DRV_TMR4_Open(void)
bool PLIB_USART_ReceiverFramingErrorHasOccurred(USART_MODULE_ID index)
uint32_t DRV_TMR4_CounterValueGet(void)
void PLIB_PORTS_PinChangeNoticeDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DRV_SPI_BUFFER_EVENT DRV_SPI_BufferStatus(DRV_SPI_BUFFER_HANDLE bufferHandle)
void DRV_TMR_Stop(DRV_HANDLE handle)
size_t SYS_DMA_ChannelDestinationTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
void DRV_ADC1_Close(void)
DRV_USART_TRANSFER_STATUS
bool PLIB_DMA_ChannelXCollisionStatus(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_COLLISION collisonType)
void PLIB_PORTS_ChangeNoticePerPortTurnOff(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
DRV_USART_CLIENT_STATUS
Definition: inszt_adc.c:15464
SYS_ERROR_LEVEL SYS_DEBUG_ErrorLevelGet(void)
void DRV_USART_WriteByte(const DRV_HANDLE handle, const uint8_t byte)
DRV_USART_ERROR DRV_USART0_ErrorGet(void)
void PLIB_DMA_CRCAppendModeDisable(DMA_MODULE_ID index)
void PLIB_USART_RunInOverflowDisable(USART_MODULE_ID index)
static void DRV_TMR0_Open(void)
void PLIB_DMA_ChannelXDataSizeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_DATA_SIZE channelDataSize)
DRV_ADC_MODULE_ID
void PLIB_DMA_ChannelXDisabledDisablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsFrameSyncPulsePolarity(SPI_MODULE_ID index)
DRV_USART_BUFFER_EVENT
void PLIB_DMA_ChannelXAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_ADDRESSING_MODE channelAddressMode)
static int wl_sps_50zqendz(int qqqi)
DMA_CRC_TYPE PLIB_DMA_CRCTypeGet(DMA_MODULE_ID index)
bool PLIB_USART_ExistsBRGClockSourceSelect(USART_MODULE_ID index)
static int wl_sps_50zqzqzq(int qqqi)
void PLIB_USART_ReceiverAddressDetectEnable(USART_MODULE_ID index)
DRV_IO_INTENT
Definition: inszt_adc.c:975
uint8_t DRV_USART0_ReadByte(void)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26603
WL_SPS_DATA WL_SPS
void PLIB_SPI_CommunicationWidthSelect(SPI_MODULE_ID index, SPI_COMMUNICATION_WIDTH width)
bool PLIB_USART_ExistsTransmitterIdleIsLow(USART_MODULE_ID index)
void SYS_PORTS_ChangeNotificationDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DRV_HANDLE DRV_SPI_Open(const SYS_MODULE_INDEX drvIndex, const DRV_IO_INTENT ioIntent)
static int tbrun_mode
Definition: inszt_wl_sps.c:97
bool PLIB_DMA_ExistsChannelXPriority(DMA_MODULE_ID index)
void PLIB_SPI_FrameErrorStatusClear(SPI_MODULE_ID index)
SYS_DMA_TRANSFER_EVENT
uint8_t DRV_USART_ReadByte(const DRV_HANDLE handle)
void PLIB_DMA_ChannelXSourceStartAddressSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint32_t sourceStartAddress)
static void DRV_TMR0_Tasks(void)
void SYS_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_FrameSyncPulseDirectionSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_DIRECTION direction)
bool array_full
Definition: inszt_app.c:28479
SYS_DMA_CHANNEL_IGNORE_MATCH
DRV_TMR_CLIENT_STATUS DRV_TMR1_ClientStatus(void)
void PLIB_SPI_InputSamplePhaseSelect(SPI_MODULE_ID index, SPI_INPUT_SAMPLING_PHASE phase)
void SYS_PORTS_DirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead2(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
void PLIB_DMA_StopInIdleEnable(DMA_MODULE_ID index)
void DRV_IC0_Initialize(void)
DRV_TMR_CLIENT_STATUS DRV_TMR2_ClientStatus(void)
void WL_SPS_Tasks(void)
S7_COMMAND
bool PLIB_USART_ExistsReceiverIdleStateLowEnable(USART_MODULE_ID index)
DRV_TMR_CLK_SOURCES
void DRV_TMR_AlarmDeregister(DRV_HANDLE handle)
void SYS_PORTS_PinWrite(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, bool value)
static void DRV_TMR4_Tasks(void)
void PLIB_USART_ReceiverDisable(USART_MODULE_ID index)
void SYS_DEBUG_Deinitialize(SYS_MODULE_OBJ object)
bool PLIB_SPI_ReceiverFIFOIsEmpty(SPI_MODULE_ID index)
void qqqtotalupload(void)
Definition: inszt_main.c:7054
bool DRV_TMR_GateModeSet(DRV_HANDLE handle)
bool PLIB_PORTS_ExistsAnPinsMode(PORTS_MODULE_ID index)
void SYS_PORTS_PinPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsCRCType(DMA_MODULE_ID index)
SYS_DMA_CHANNEL_OP_MODE
Definition: inszt_adc.c:13381
bool PLIB_USART_ExistsReceiverAddress(USART_MODULE_ID index)
SPI_FRAME_PULSE_EDGE framePulseEdge
Definition: inszt_adc.c:26555
void PLIB_USART_AddressMaskSet(USART_MODULE_ID index, uint8_t mask)
static int wl_sps_50zqqzqz(qqnull_params)
bool PLIB_SPI_ExistsStopInIdleControl(SPI_MODULE_ID index)
uintptr_t DRV_USART_BUFFER_HANDLE
DRV_SPI_CLOCK_MODE
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART0_LineControlSet(DRV_USART_LINE_CONTROL lineControlMode)
static void qqqupload(qqnull_params)
SPI_MODULE_ID spiId
Definition: inszt_adc.c:26537
void PLIB_SPI_PinDisable(SPI_MODULE_ID index, SPI_PIN pin)
void PLIB_DMA_ChannelXDestinationSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t destinationSize)
bool DRV_USART0_TransmitBufferIsFull(void)
void PLIB_USART_InitializeModeGeneral(USART_MODULE_ID index, bool autobaud, bool loopBackMode, bool wakeFromSleep, bool irdaMode, bool stopInIdle)
void PLIB_SPI_FrameSyncPulsePolaritySelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_POLARITY polarity)
uint16_t v_array[50]
Definition: inszt_app.c:28473
void PLIB_SPI_StopInIdleEnable(SPI_MODULE_ID index)
void SYS_PORTS_PinOpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_ADC0_Open(void)
bool PLIB_DMA_ExistsChannelXChain(DMA_MODULE_ID index)
void PLIB_SPI_ErrorInterruptDisable(SPI_MODULE_ID index, SPI_ERROR_INTERRUPT error)
void DRV_ADC1_Open(void)
bool PLIB_PORTS_PinChangeNoticeEdgeHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DRV_TMR_OPERATION_MODE DRV_TMR4_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
bool DRV_TMR3_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
static void DRV_TMR1_Tasks(void)
bool PLIB_DMA_CRCAppendModeIsEnabled(DMA_MODULE_ID index)
void Set_Status(uint8_t bitposn)
void SYS_DEBUG_Print(const char *format,...)
bool PLIB_PORTS_ExistsPortsWrite(PORTS_MODULE_ID index)
SYS_ERROR_LEVEL
Definition: inszt_adc.c:17548
SYS_STATUS SYS_DEBUG_Status(SYS_MODULE_OBJ object)
static void qqoutput3(FILEPOINT char *s, int i, int j, int k)
uint32_t PLIB_DMA_ChannelXDestinationStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
bool PLIB_DMA_ExistsChannelXCellProgressPointer(DMA_MODULE_ID index)
S3_COMMAND S3_state
Definition: inszt_app.c:27774
uintptr_t DRV_USART_BUFFER_HANDLE
Definition: inszt_adc.c:15035
static DRV_TMR_OPERATION_MODE DRV_TMR1_OperationModeGet(void)
void PLIB_DMA_ChannelXINTSourceFlagClear(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void DRV_TMR4_CounterClear(void)
bool DRV_TMR4_Start(void)
bool PLIB_USART_ExistsRunInOverflow(USART_MODULE_ID index)
void(* DRV_SPI_BUFFER_EVENT_HANDLER)(DRV_SPI_BUFFER_EVENT event, DRV_SPI_BUFFER_HANDLE bufferHandle, void *context)
bool PLIB_USART_ExistsIrDA(USART_MODULE_ID index)
bool PLIB_USART_ExistsReceiverParityErrorStatus(USART_MODULE_ID index)
void PLIB_USART_ReceiverOverrunErrorClear(USART_MODULE_ID index)
int16_t PLIB_USART_Receiver9BitsReceive(USART_MODULE_ID index)
USART_ERROR PLIB_USART_ErrorsGet(USART_MODULE_ID index)
void SYS_PORTS_PinPullDownEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_PinPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void PLIB_SPI_TransmitUnderRunStatusClear(SPI_MODULE_ID index)
bool PLIB_USART_ExistsReceiverIdleStatus(USART_MODULE_ID index)
SYS_MODULE_OBJ DRV_IC_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
void SYS_DMA_ChannelTransferSet(SYS_DMA_CHANNEL_HANDLE handle, const void *srcAddr, size_t srcSize, const void *destAddr, size_t destSize, size_t cellSize)
ADC_STATES
Definition: adc.h:55
#define qqqbranches
PORTS_PIN_SLEW_RATE PLIB_PORTS_PinSlewRateGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsCRC(DMA_MODULE_ID index)
uint32_t DRV_TMR0_CounterFrequencyGet(void)
void Prepare_Return_A(uint8_t byte, uint16_t data2, uint16_t data1)
bool PLIB_PORTS_ExistsChangeNoticeInIdle(PORTS_MODULE_ID index)
bool PLIB_PORTS_ExistsPortsRead(PORTS_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26610
static void process_switches(void)
bool PLIB_PORTS_ExistsChangeNoticeEdgeControl(PORTS_MODULE_ID index)
bool PLIB_SPI_FrameErrorStatusGet(SPI_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticeMethodSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_CHANGE_NOTICE_METHOD changeNoticeMethod)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
CLK_BUSES_PERIPHERAL spiClk
Definition: inszt_adc.c:26570
bool PLIB_USART_WakeOnStartIsEnabled(USART_MODULE_ID index)
static SYS_STATUS DRV_TMR0_Status(void)
void SYS_DMA_ChannelResume(SYS_DMA_CHANNEL_HANDLE handle)
S4_COMMAND
void PLIB_DMA_ChannelXAutoDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void DRV_USART_TasksTransmit(SYS_MODULE_OBJ object)
void SYS_DMA_ChannelSuspend(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_USART_ExistsWakeOnStart(USART_MODULE_ID index)
void PLIB_DMA_CRCPolynomialLengthSet(DMA_MODULE_ID index, uint8_t polyLength)
void ADC_Tasks(void)
Definition: adc.c:75
void PLIB_DMA_AbortTransferSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint32_t DRV_TMR2_PeriodValueGet(void)
void PLIB_DMA_Enable(DMA_MODULE_ID index)
void Set_WL_SPS_CurrentLimit(uint16_t value)
DRV_USART_LINE_CONTROL_SET_RESULT
void PLIB_USART_BRGClockSourceSelect(USART_MODULE_ID index, USART_BRG_CLOCK_SOURCE brgClockSource)
bool PLIB_USART_ExistsLineControlMode(USART_MODULE_ID index)
bool DRV_TMR1_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool PLIB_DMA_ExistsChannelXSourceSize(DMA_MODULE_ID index)
void SYS_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void SYS_PORTS_ChangeNotificationGlobalDisable(PORTS_MODULE_ID index)
bool DRV_TMR0_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
SPI_COMMUNICATION_WIDTH commWidth
Definition: inszt_adc.c:26563
void DRV_TMR0_CounterClear(void)
uint32_t PLIB_DMA_CRCXOREnableGet(DMA_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeEnable(PORTS_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
DRV_USART_CLIENT_STATUS
size_t SYS_DMA_ChannelSourceTransferredSizeGet(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_SPI_ExistsInputSamplePhase(SPI_MODULE_ID index)
DRV_HANDLE DRV_TMR_Open(const SYS_MODULE_INDEX index, const DRV_IO_INTENT intent)
bool PLIB_SPI_ReceiverHasOverflowed(SPI_MODULE_ID index)
void PLIB_DMA_CRCWriteByteOrderAlter(DMA_MODULE_ID index)
bool PLIB_USART_ExistsHandshakeMode(USART_MODULE_ID index)
bool DRV_SPIn_TransmitterBufferIsFull(void)
void PLIB_DMA_ChannelXAutoEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_PORTS_PinOpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsChannelXStartIRQ(DMA_MODULE_ID index)
void DRV_USART0_TasksError(void)
void PLIB_SPI_MasterEnable(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXStartIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQnum)
void SYS_DMA_TasksError(SYS_MODULE_OBJ object)
void PLIB_PORTS_ChangeNoticePullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_USART_RunInOverflowIsEnabled(USART_MODULE_ID index)
float32_t v_avg
Definition: inszt_app.c:28476
static DRV_TMR_OPERATION_MODE DRV_TMR4_OperationModeGet(void)
uint16_t upper_current_limit
Definition: inszt_app.c:28459
uint32_t PORTS_DATA_TYPE
Definition: inszt_adc.c:18532
void PLIB_USART_TransmitterEnable(USART_MODULE_ID index)
void PLIB_PORTS_ChannelChangeNoticePullDownDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
ldra_void_function qqqaccumupload[QQQnumfil]
Definition: inszt_main.c:153
DRV_USART_OPERATION_MODE
Definition: inszt_adc.c:15059
static SYS_STATUS DRV_TMR3_Status(void)
void PLIB_SPI_AudioCommunicationWidthSelect(SPI_MODULE_ID index, SPI_AUDIO_COMMUNICATION_WIDTH mode)
ADC_DATA ADC
Definition: adc.c:53
S1_COMMAND
Definition: inszt_app.c:27739
DRV_USART_ERROR
Definition: inszt_adc.c:15426
uint16_t upper_voltage_limit
Definition: inszt_app.c:28454
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWriteRead2(DRV_HANDLE handle, void *txBuffer, size_t txSize, void *rxBuffer, size_t rxSize, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
uint8_t queueSize
Definition: inszt_adc.c:26592
void PLIB_DMA_ChannelXTransferDirectionSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_TRANSFER_DIRECTION chTransferDirection)
SWITCH_STATES
uint32_t DRV_IC_Capture32BitDataRead(DRV_HANDLE handle)
void DRV_USART0_TasksReceive(void)
int qqqshell_upload
Definition: inszt_main.c:150
SYS_DMA_ERROR SYS_DMA_ChannelErrorGet(SYS_DMA_CHANNEL_HANDLE handle)
bool PLIB_SPI_ExistsClockPolarity(SPI_MODULE_ID index)
void PLIB_SPI_AudioErrorDisable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
SYS_PORTS_PULLUP_PULLDOWN_STATUS
Definition: inszt_adc.c:21864
bool PLIB_SPI_ExistsFIFOCount(SPI_MODULE_ID index)
void DRV_TMR1_CounterValueSet(uint32_t value)
SYS_STATUS DRV_TMR_Status(SYS_MODULE_OBJ object)
void PLIB_DMA_ChannelXDisabledEnablesEvents(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_USART_WakeOnStartEnable(USART_MODULE_ID index)
size_t DRV_USART_BufferCompletedBytesGet(DRV_USART_BUFFER_HANDLE bufferHandle)
void DRV_ADC_DeInitialize(void)
void PLIB_DMA_CRCBitOrderSelect(DMA_MODULE_ID index, DMA_CRC_BIT_ORDER bitOrder)
void SYS_PORTS_Initialize()
uint32_t PLIB_SPI_BufferRead32bit(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortTurnOn(PORTS_MODULE_ID index)
void PLIB_DMA_CRCDisable(DMA_MODULE_ID index)
void SYS_PORTS_InterruptEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos, PORTS_PIN_INTERRUPT_TYPE pinInterruptType)
void DRV_TMR2_Stop(void)
DRV_USART_OPERATION_MODE
bool PLIB_PORTS_ExistsPinMode(PORTS_MODULE_ID index)
DRV_TMR_CLIENT_STATUS DRV_TMR_ClientStatus(DRV_HANDLE handle)
uint16_t voltage
Definition: inszt_app.c:28452
DRV_SPI_BUFFER_EVENT_HANDLER operationEnded
Definition: inszt_adc.c:26642
bool PLIB_SPI_ExistsErrorInterruptControl(SPI_MODULE_ID index)
static void qqqbitmapreset(qqnull_params)
void DRV_USART_ByteReceiveCallbackSet(const SYS_MODULE_INDEX index, const DRV_USART_BYTE_EVENT_HANDLER eventHandler)
void PLIB_DMA_BusyActiveSet(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsEnableControl(DMA_MODULE_ID index)
bool PLIB_USART_ExistsRunInSleepMode(USART_MODULE_ID index)
uintptr_t DRV_SPI_BUFFER_HANDLE
uint8_t PLIB_USART_AddressGet(USART_MODULE_ID index)
bool PLIB_USART_ExistsLoopback(USART_MODULE_ID index)
void PLIB_DMA_ChannelXStartAddressOffsetSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t address, DMA_ADDRESS_OFFSET_TYPE offset)
bool spiSlaveSSPin
Definition: inszt_adc.c:26547
uint32_t PLIB_DMA_ChannelXSourceStartAddressGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_DMA_ChannelXNullWriteModeDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
void PLIB_DMA_ChannelPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL_PRIORITY channelPriority)
static DRV_TMR_OPERATION_MODE DRV_TMR2_OperationModeGet(void)
void DRV_TMR_Close(DRV_HANDLE handle)
static SYS_STATUS DRV_TMR4_Status(void)
bool PLIB_SPI_ExistsBaudRate(SPI_MODULE_ID index)
DRV_USART_BUFFER_EVENT
Definition: inszt_adc.c:15096
DRV_SPI_CLOCK_MODE
Definition: inszt_adc.c:26299
static void qqoutput2(FILEPOINT char *s, int i, int j)
void(* DRV_USART_BUFFER_EVENT_HANDLER)(DRV_USART_BUFFER_EVENT event, DRV_USART_BUFFER_HANDLE bufferHandle, uintptr_t context)
void PLIB_SPI_FIFOInterruptModeSelect(SPI_MODULE_ID index, SPI_FIFO_INTERRUPT mode)
void PLIB_PORTS_PinClear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
uint32_t DRV_IC0_Capture32BitDataRead(void)
DRV_IO_INTENT
Definition: inszt_wl_sps.c:887
void(* ldra_void_function)()
Definition: inszt_wl_sps.c:115
bool PLIB_DMA_ExistsChannelXPatternData(DMA_MODULE_ID index)
DRV_TMR_OPERATION_MODE
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void DRV_IC_Stop(DRV_HANDLE handle)
void PLIB_PORTS_OpenDrainEnable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddWrite2(DRV_HANDLE handle, void *txBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context, DRV_SPI_BUFFER_HANDLE *jobHandle)
DRV_USART_INIT_FLAGS
Definition: inszt_adc.c:15364
SYS_DMA_CRC_WRITE_ORDER
Definition: inszt_adc.c:13358
void PLIB_DMA_CRCEnable(DMA_MODULE_ID index)
static void DRV_TMR3_DeInitialize(void)
void PLIB_PORTS_Set(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value, PORTS_DATA_MASK mask)
void DRV_TMR3_StopInIdleDisable(void)
void PLIB_USART_TransmitterDisable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXSourceSizeSet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, uint16_t sourceSize)
USART_BRG_CLOCK_SOURCE PLIB_USART_BRGClockSourceGet(USART_MODULE_ID index)
uint32_t DRV_TMR4_CounterFrequencyGet(void)
uint8_t PLIB_SPI_BufferRead(SPI_MODULE_ID index)
void SYS_DMA_ChannelDisable(SYS_DMA_CHANNEL_HANDLE handle)
DRV_SPI_BUFFER_EVENT
void SYS_PORTS_Clear(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK clearMask)
void PLIB_DMA_ChannelXNullWriteModeEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
uint16_t offset
Definition: inszt_app.c:28463
uintptr_t SYS_DMA_CHANNEL_HANDLE
bool PLIB_DMA_ExistsChannelXINTSource(DMA_MODULE_ID index)
DRV_TMR_OPERATION_MODE DRV_TMR0_DividerRangeGet(DRV_TMR_DIVIDER_RANGE *pDivRange)
static DRV_TMR_OPERATION_MODE DRV_TMR0_OperationModeGet(void)
void PLIB_USART_BaudSetAndEnable(USART_MODULE_ID index, uint32_t systemClock, uint32_t baud)
DRV_USART_TRANSFER_STATUS DRV_USART_TransferStatus(const DRV_HANDLE handle)
bool SYS_DMA_IsBusy(void)
bool new_current_values_flag
Definition: inszt_app.c:28466
void PLIB_SPI_BufferWrite32bit(SPI_MODULE_ID index, uint32_t data)
void SYS_PORTS_ChangeNotificationPullUpDisable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
uint16_t PLIB_DMA_ChannelXDestinationSizeGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
void PLIB_SPI_AudioErrorEnable(SPI_MODULE_ID index, SPI_AUDIO_ERROR error)
void SYS_PORTS_PinModeSelect(PORTS_MODULE_ID index, PORTS_ANALOG_PIN pin, PORTS_PIN_MODE mode)
uint32_t DRV_TMR_CounterValueGet(DRV_HANDLE handle)
void DRV_TMR0_PeriodValueSet(uint32_t value)
bool new_voltage_values_flag
Definition: inszt_app.c:28467
SPI_INPUT_SAMPLING_PHASE inputSamplePhase
Definition: inszt_adc.c:26578
SYS_DMA_CHANNEL_HANDLE SYS_DMA_ChannelAllocate(DMA_CHANNEL channel)
bool PLIB_SPI_ExistsAudioTransmitMode(SPI_MODULE_ID index)
DRV_SPI_BUFFER_EVENT_HANDLER operationStarting
Definition: inszt_adc.c:26635
void DRV_PMP0_ModeConfig(void)
bool PLIB_SPI_ExistsOutputDataPhase(SPI_MODULE_ID index)
void PLIB_DMA_ChannelXDestinationAddressModeSelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_DESTINATION_ADDRESSING_MODE destinationAddressMode)
DRV_SPI_BUFFER_HANDLE DRV_SPI_BufferAddRead(DRV_HANDLE handle, void *rxBuffer, size_t size, DRV_SPI_BUFFER_EVENT_HANDLER completeCB, void *context)
void DRV_TMR2_StopInIdleEnable(void)
void SYS_PORTS_Write(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_TYPE value)
unsigned int DRV_USART0_ReceiverBufferSizeGet(void)
void DRV_TMR_AlarmPeriodSet(DRV_HANDLE handle, uint32_t value)
static void DRV_TMR1_Open(void)
static void DRV_TMR3_Open(void)
void(* DRV_TMR_CALLBACK)(uintptr_t context, uint32_t alarmCount)
uint16_t PLIB_DMA_ChannelXStartAddressOffsetGet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_ADDRESS_OFFSET_TYPE offset)
void DRV_TMR0_StopInIdleDisable(void)
void PLIB_SPI_AudioProtocolModeSelect(SPI_MODULE_ID index, SPI_AUDIO_PROTOCOL mode)
DRV_USART_CLIENT_STATUS DRV_USART0_ClientStatus(void)
DRV_SPI_TASK_MODE
size_t DRV_USART_Write(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
void DRV_SPI_Deinitialize(SYS_MODULE_OBJ object)
void SYS_PORTS_ChangeNotificationPullUpEnable(PORTS_MODULE_ID index, PORTS_CHANGE_NOTICE_PIN pinNum)
bool PLIB_PORTS_ExistsChangeNoticePullDownPerPort(PORTS_MODULE_ID index)
uint8_t overvoltage_count
Definition: inszt_app.c:28480
bool DRV_TMR4_ClockSet(DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE prescale)
bool PLIB_USART_ExistsTransmitterEmptyStatus(USART_MODULE_ID index)
SYS_DMA_DATA_WIDTH
void PLIB_PORTS_Toggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK toggleMask)
bool PLIB_SPI_ReceiverBufferIsFull(SPI_MODULE_ID index)
static void DRV_TMR1_DeInitialize(void)
SWITCH_STATES
Definition: inszt_app.c:27636
void SYS_PORTS_OpenDrainDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK mask)
bool DRV_TMR_AlarmDisable(DRV_HANDLE handle)
void DRV_TMR4_StopInIdleEnable(void)
void * PLIB_SPI_BufferAddressGet(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsPinChangeNotice(PORTS_MODULE_ID index)
uint16_t PLIB_DMA_ChannelXTransferCountGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_DMA_ExistsChannelXDestinationPointer(DMA_MODULE_ID index)
bool DRV_IC0_BufferIsEmpty(void)
DRV_USART_CLIENT_STATUS DRV_USART_ClientStatus(DRV_HANDLE handle)
SPI_AUDIO_TRANSMIT_MODE audioTransmitMode
Definition: inszt_adc.c:26559
void PLIB_DMA_ChannelXReloadEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsFrameErrorStatus(SPI_MODULE_ID index)
static void DRV_TMR1_Close(void)
uint32_t DRV_TMR1_CounterFrequencyGet(void)
void PLIB_SPI_FramedCommunicationDisable(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticePullUpPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_DMA_ExistsChannelXAbortIRQ(DMA_MODULE_ID index)
uintptr_t DRV_SPI_BUFFER_HANDLE
Definition: inszt_adc.c:26247
void DRV_TMR2_CounterValueSet(uint32_t value)
void PLIB_USART_RunInSleepModeEnable(USART_MODULE_ID index)
void PLIB_DMA_ChannelXINTSourceDisable(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
void PLIB_DMA_BusyActiveReset(DMA_MODULE_ID index)
DRV_IO_BUFFER_TYPES
Definition: inszt_wl_sps.c:988
void DRV_USART0_Close(void)
void SYS_DMA_TasksErrorISR(SYS_MODULE_OBJ object, DMA_CHANNEL activeChannel)
static void qqoutput(FILEPOINT char *s, int i)
bool PLIB_USART_ExistsModuleBusyStatus(USART_MODULE_ID index)
SPI_AUDIO_PROTOCOL audioProtocolMode
Definition: inszt_adc.c:26561
SYS_PORTS_PIN_DIRECTION
void PLIB_DMA_ChannelXBusyInActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool overvoltage_flag
Definition: inszt_app.c:28469
uint8_t numTrfsSmPolled
Definition: inszt_adc.c:26587
DRV_SPI_CLOCK_MODE clockMode
Definition: inszt_adc.c:26576
bool PLIB_USART_RunInSleepModeIsEnabled(USART_MODULE_ID index)
SYS_STATUS DRV_USART_Status(SYS_MODULE_OBJ object)
bool PLIB_SPI_ExistsAudioCommunicationWidth(SPI_MODULE_ID index)
bool PLIB_PORTS_ExistsRemapInput(PORTS_MODULE_ID index)
void DRV_TMR2_StopInIdleDisable(void)
PORTS_DATA_MASK PLIB_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
S4_COMMAND
Definition: inszt_app.c:27708
void PLIB_PORTS_PinDirectionOutputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR0_Initialize(void)
void PLIB_USART_ReceiverAddressDetectDisable(USART_MODULE_ID index)
DRV_USART_HANDSHAKE
bool PLIB_SPI_TransmitBufferIsFull(SPI_MODULE_ID index)
void DRV_TMR1_Stop(void)
uintptr_t SYS_DMA_CHANNEL_HANDLE
Definition: inszt_adc.c:13249
DRV_USART_BAUD_SET_RESULT DRV_USART0_BaudSet(uint32_t baud)
APP_DATA APP
Definition: app.c:73
#define DRV_IC_Close(handle)
static void DRV_TMR4_Close(void)
void SYS_DMA_ChannelSetupMatchAbortMode(SYS_DMA_CHANNEL_HANDLE handle, uint16_t pattern, DMA_PATTERN_LENGTH length, SYS_DMA_CHANNEL_IGNORE_MATCH ignore, uint8_t ignorePattern)
uint16_t PLIB_DMA_ChannelXSourcePointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DRV_TMR_CLIENT_STATUS DRV_TMR4_ClientStatus(void)
void PLIB_DMA_ChannelXPrioritySelect(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_CHANNEL_PRIORITY channelPriority)
PORTS_DATA_TYPE SYS_PORTS_Read(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
Definition: app.h:59
bool PLIB_SPI_ExistsReceiverOverflow(SPI_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeInIdlePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
SYS_STATUS DRV_SPI_Status(SYS_MODULE_OBJ object)
static void qqoutput0(FILEPOINT char *s)
uint32_t DRV_TMR0_CounterValueGet(void)
Definition: adc.h:78
void DRV_USART_AddressedBufferAddWrite(const DRV_HANDLE hClient, DRV_USART_BUFFER_HANDLE *bufferHandle, uint8_t address, void *source, size_t nWords)
DRV_USART_BAUD_SET_RESULT
bool PLIB_DMA_ExistsStopInIdle(DMA_MODULE_ID index)
void PLIB_SPI_SlaveSelectDisable(SPI_MODULE_ID index)
DRV_USART_BUFFER_RESULT
Definition: inszt_adc.c:15118
void PLIB_SPI_BaudRateClockSelect(SPI_MODULE_ID index, SPI_BAUD_RATE_CLOCK type)
void DRV_TMR1_StopInIdleDisable(void)
bool PLIB_USART_ReceiverIsIdle(USART_MODULE_ID index)
void APP_Initialize(void)
Definition: app.c:93
void PLIB_PORTS_ChannelSlewRateSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK channelMask, PORTS_PIN_SLEW_RATE slewRate)
void DRV_TMR2_PeriodValueSet(uint32_t value)
void PLIB_DMA_ChannelXDisable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ReceiverAddressIsReceived(USART_MODULE_ID index)
bool PLIB_DMA_ExistsCRCData(DMA_MODULE_ID index)
uint32_t DRV_ADC_SamplesRead(uint8_t bufIndex)
void SYS_PORTS_PinDirectionSelect(PORTS_MODULE_ID index, SYS_PORTS_PIN_DIRECTION pinDir, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR4_PeriodValueSet(uint32_t value)
INT_SOURCE rxInterruptSource
Definition: inszt_adc.c:26582
void DRV_TMR3_Stop(void)
void DRV_TMR_Deinitialize(SYS_MODULE_OBJ object)
PORTS_PIN_INTERRUPT_TYPE
Definition: inszt_adc.c:21903
bool PLIB_SPI_ExistsReadDataSignStatus(SPI_MODULE_ID index)
bool PLIB_USART_ExistsReceiverDataAvailableStatus(USART_MODULE_ID index)
DRV_TMR_CLIENT_STATUS
void SET_WL_SPS_IOffset(uint8_t mode)
void DRV_TMR3_PeriodValueSet(uint32_t value)
#define wl_sps_50zzopen
Definition: inszt_wl_sps.c:77
bool PLIB_USART_ExistsReceiverEnable(USART_MODULE_ID index)
bool PLIB_SPI_IsBusy(SPI_MODULE_ID index)
void PLIB_USART_ReceiverIdleStateLowEnable(USART_MODULE_ID index)
uint16_t sensor_offset
Definition: inszt_app.c:28470
SYS_DMA_ERROR
void PLIB_USART_RunInOverflowEnable(USART_MODULE_ID index)
uint32_t DRV_TMR2_CounterFrequencyGet(void)
#define FILEPOINT
Definition: inszt_wl_sps.c:92
void PLIB_USART_StopInIdleEnable(USART_MODULE_ID index)
uint16_t sensor_constant
Definition: inszt_app.c:28471
void DRV_TMR_CounterValueSet(DRV_HANDLE handle, uint32_t counterPeriod)
SYS_DMA_CHANNEL_OP_MODE
SYS_MODULE_OBJ DRV_SPI_Initialize(const SYS_MODULE_INDEX index, const SYS_MODULE_INIT *const init)
uint16_t wl_sps_i
Definition: adc.h:88
DMA_CHANNEL PLIB_DMA_CRCChannelGet(DMA_MODULE_ID index)
bool DRV_TMR2_Start(void)
uint8_t PLIB_SPI_FIFOCountGet(SPI_MODULE_ID index, SPI_FIFO_TYPE type)
void PLIB_DMA_CRCDataWrite(DMA_MODULE_ID index, uint32_t DMACRCdata)
void PLIB_SPI_OutputDataPhaseSelect(SPI_MODULE_ID index, SPI_OUTPUT_DATA_PHASE phase)
INT_SOURCE errInterruptSource
Definition: inszt_adc.c:26584
void PLIB_USART_ReceiverIdleStateLowDisable(USART_MODULE_ID index)
DRV_TMR_CLK_SOURCES
Definition: inszt_adc.c:1694
void PLIB_SPI_Enable(SPI_MODULE_ID index)
void SYS_DMA_Suspend(void)
void PLIB_PORTS_PinDirectionInputSet(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
SYS_DMA_CHANNEL_CRC_MODE
ldra_void_function qqqaccumreset[QQQnumfil]
Definition: inszt_main.c:154
static int zzfileid
Definition: inszt_wl_sps.c:50
int8_t PLIB_USART_ReceiverByteReceive(USART_MODULE_ID index)
SYS_ERROR_LEVEL
bool PLIB_USART_ExistsStopInIdle(USART_MODULE_ID index)
TMR_PRESCALE DRV_TMR2_PrescalerGet(void)
void PLIB_SPI_FrameSyncPulseCounterSelect(SPI_MODULE_ID index, SPI_FRAME_SYNC_PULSE pulse)
bool DRV_IC_BufferIsEmpty(DRV_HANDLE handle)
bool PLIB_SPI_ExistsFIFOControl(SPI_MODULE_ID index)
bool DRV_USART_ReceiverBufferIsEmpty(const DRV_HANDLE handle)
void SYS_DMA_ChannelForceAbort(SYS_DMA_CHANNEL_HANDLE handle)
bool DRV_TMR_ClockSet(DRV_HANDLE handle, DRV_TMR_CLK_SOURCES clockSource, TMR_PRESCALE preScale)
void SYS_DEBUG_Message(const char *message)
uint16_t DRV_IC0_Capture16BitDataRead(void)
uint16_t current
Definition: inszt_app.c:28456
void DRV_TMR4_Initialize(void)
uint16_t PLIB_DMA_ChannelXCellProgressPointerGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel)
DRV_SPI_MODE spiMode
Definition: inszt_adc.c:26541
bool sensor_offset_tick
Definition: inszt_app.c:28472
bool PLIB_SPI_ExistsAudioErrorControl(SPI_MODULE_ID index)
bool PLIB_SPI_ExistsFrameSyncPulseEdge(SPI_MODULE_ID index)
void PLIB_SPI_Disable(SPI_MODULE_ID index)
void DRV_PMP0_Initialize(void)
static void DRV_TMR2_Open(void)
void PLIB_PORTS_ChangeNoticePullDownPerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
DMA_PING_PONG_MODE PLIB_DMA_ChannelXPingPongModeGet(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_SPI_ExistsTransmitUnderRunStatus(SPI_MODULE_ID index)
void PLIB_PORTS_CnPinsDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
bool PLIB_PORTS_ExistsPortsOpenDrain(PORTS_MODULE_ID index)
void PLIB_DMA_ChannelXPatternIgnoreSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint8_t pattern)
void PLIB_DMA_ChannelXPatternIgnoreByteEnable(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool DRV_TMR1_Start(void)
bool PLIB_DMA_ExistsChannelXCellSize(DMA_MODULE_ID index)
void PLIB_DMA_SuspendEnable(DMA_MODULE_ID index)
SYS_STATUS DRV_USART0_Status(void)
bool PLIB_DMA_ExistsChannelXSourcePointer(DMA_MODULE_ID index)
DRV_SPI_PROTOCOL_TYPE
bool PLIB_SPI_ExistsSlaveSelectControl(SPI_MODULE_ID index)
void DRV_TMR_Tasks(SYS_MODULE_OBJ object)
DRV_USART_LINE_CONTROL_SET_RESULT DRV_USART_LineControlSet(const DRV_HANDLE client, const DRV_USART_LINE_CONTROL lineControl)
bool PLIB_DMA_ExistsCRCWriteByteOrder(DMA_MODULE_ID index)
bool PLIB_PORTS_ExistsChangeNoticePerPortStatus(PORTS_MODULE_ID index)
void PLIB_PORTS_ChangeNoticeDisable(PORTS_MODULE_ID index)
void DRV_TMR3_StopInIdleEnable(void)
DRV_SPI_TASK_MODE taskMode
Definition: inszt_adc.c:26539
bool PLIB_DMA_ChannelXINTSourceFlagGet(DMA_MODULE_ID index, DMA_CHANNEL dmaChannel, DMA_INT_TYPE dmaINTSource)
PORTS_PIN_INTERRUPT_TYPE
void PLIB_DMA_ChannelXBusyActiveSet(DMA_MODULE_ID index, DMA_CHANNEL channel)
PORTS_DATA_MASK SYS_PORTS_DirectionGet(PORTS_MODULE_ID index, PORTS_CHANNEL channel)
void PLIB_DMA_ChannelXPeripheralAddressSet(DMA_MODULE_ID index, DMA_CHANNEL channel, uint16_t peripheraladdress)
SYS_MODULE_OBJ SYS_DMA_Initialize(const SYS_MODULE_INIT *const init)
DRV_USART_INIT_FLAGS
void DRV_TMR_CounterClear(DRV_HANDLE handle)
void DRV_TMR0_CounterValueSet(uint32_t value)
uint32_t DRV_TMR_AlarmHasElapsed(DRV_HANDLE handle)
void DRV_USART_BufferAddWrite(const DRV_HANDLE handle, DRV_USART_BUFFER_HANDLE *bufferHandle, void *buffer, const size_t size)
bool PLIB_SPI_TransmitBufferIsEmpty(SPI_MODULE_ID index)
bool PLIB_DMA_CRCIsEnabled(DMA_MODULE_ID index)
void PLIB_DMA_CRCByteOrderSelect(DMA_MODULE_ID index, DMA_CRC_BYTE_ORDER byteOrder)
static void DRV_TMR3_Tasks(void)
bool DRV_TMR_AlarmRegister(DRV_HANDLE handle, uint32_t divider, bool isPeriodic, uintptr_t context, DRV_TMR_CALLBACK callBack)
void DRV_TMR4_CounterValueSet(uint32_t value)
static void DRV_TMR3_Close(void)
void SYS_DEBUG_ErrorLevelSet(SYS_ERROR_LEVEL level)
bool PLIB_SPI_Exists16bitBuffer(SPI_MODULE_ID index)
void SYS_DMA_ChannelEnable(SYS_DMA_CHANNEL_HANDLE handle)
static void qqqqinitialise(int ii)
void PLIB_PORTS_CnPinsPullUpDisable(PORTS_MODULE_ID index, PORTS_CN_PIN cnPins)
SYS_DMA_CHANNEL_CHAIN_PRIO
void PLIB_PORTS_PinChangeNoticePerPortDisable(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
void DRV_TMR1_PeriodValueSet(uint32_t value)
bool PLIB_SPI_ExistsAudioProtocolMode(SPI_MODULE_ID index)
void DRV_USART_BufferEventHandlerSet(const DRV_HANDLE handle, const DRV_USART_BUFFER_EVENT_HANDLER eventHandler, const uintptr_t context)
void PLIB_USART_TransmitterBreakSend(USART_MODULE_ID index)
void PLIB_PORTS_ChannelModeSelect(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_DATA_MASK modeMask, PORTS_PIN_MODE mode)
unsigned int DRV_USART0_TransmitBufferSizeGet(void)
void DRV_TMR1_StopInIdleEnable(void)
void PLIB_SPI_FIFOEnable(SPI_MODULE_ID index)
void PLIB_DMA_CRCWriteByteOrderMaintain(DMA_MODULE_ID index)
void PLIB_DMA_CRCChannelSelect(DMA_MODULE_ID index, DMA_CHANNEL channel)
bool PLIB_USART_ExistsEnable(USART_MODULE_ID index)
static int QQQfirstmcdc
Definition: inszt_wl_sps.c:76
void DRV_SPI_Tasks(SYS_MODULE_OBJ object)
DRV_TMR_CLIENT_STATUS DRV_TMR0_ClientStatus(void)
TMR_PRESCALE DRV_TMR1_PrescalerGet(void)
void PLIB_USART_ReceiverAddressAutoDetectEnable(USART_MODULE_ID index, int8_t Mask)
SYS_DMA_CRC_WRITE_ORDER
SPI_FRAME_SYNC_PULSE frameSyncPulse
Definition: inszt_adc.c:26549
void DRV_USART0_TasksTransmit(void)
void PLIB_USART_Disable(USART_MODULE_ID index)
void DRV_TMR2_CounterClear(void)
int32_t DRV_SPI_ClientConfigure(DRV_HANDLE handle, const DRV_SPI_CLIENT_DATA *cfgData)
void PLIB_SPI_FrameSyncPulseWidthSelect(SPI_MODULE_ID index, SPI_FRAME_PULSE_WIDTH width)
uint8_t PLIB_DMA_CRCPolynomialLengthGet(DMA_MODULE_ID index)
bool PLIB_USART_ModuleIsBusy(USART_MODULE_ID index)
void PLIB_DMA_ChannelXAbortIRQSet(DMA_MODULE_ID index, DMA_CHANNEL channel, DMA_TRIGGER_SOURCE IRQ)
bool PLIB_DMA_ExistsChannelXSourceStartAddress(DMA_MODULE_ID index)
void PLIB_PORTS_PinToggle(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ExistsBaudRate(USART_MODULE_ID index)
static void qqbmsoutput(FILEPOINT char *s, unsigned int i)
SYS_DMA_TRANSFER_EVENT
Definition: inszt_adc.c:13469
DRV_USART_BUFFER_RESULT
uint8_t PLIB_DMA_ChannelBitsGet(DMA_MODULE_ID index)
void PLIB_USART_LineControlModeSelect(USART_MODULE_ID index, USART_LINECONTROL_MODE dataFlowConfig)
size_t DRV_USART_Read(const DRV_HANDLE handle, void *buffer, const size_t numbytes)
bool PLIB_SPI_ExistsAudioProtocolControl(SPI_MODULE_ID index)
static int wl_sps_50zscanf(char *qqscan_str)
void SYS_DMA_ChannelCRCSet(SYS_DMA_CHANNEL_HANDLE handle, SYS_DMA_CHANNEL_OPERATION_MODE_CRC crc)
S5_COMMAND
Definition: inszt_app.c:27754
bool PLIB_DMA_ExistsChannelXDisabled(DMA_MODULE_ID index)
bool PLIB_PORTS_ChangeNoticePerPortHasOccurred(PORTS_MODULE_ID index, PORTS_CHANNEL channel, PORTS_BIT_POS bitPos)
bool PLIB_USART_ExistsReceiver(USART_MODULE_ID index)
uint32_t DRV_TMR1_CounterValueGet(void)
static void DRV_TMR2_Tasks(void)
uint32_t SYS_DMA_ChannelCRCGet(void)
DMA_CHANNEL_PRIORITY PLIB_DMA_ChannelPriorityGet(DMA_MODULE_ID index)
bool PLIB_DMA_ExistsStartTransfer(DMA_MODULE_ID index)
bool PLIB_SPI_ExistsReceiveFIFOStatus(SPI_MODULE_ID index)
void qqpopulate_array_fcn_ptrQQ(int x, ldra_void_function y, ldra_void_function z)
Definition: inszt_main.c:157
PORTS_DATA_TYPE PLIB_PORTS_ReadLatched(PORTS_MODULE_ID index, PORTS_CHANNEL channel)